Add #errors when !OPUS_BUILD or !(VAR_ARRAYS||USE_ALLOCA||NONTHREADSAFE_PSEUDOSTACK).

This will help prevent people using non-standard build environments from
footgunning themselves and becoming a support burden.
This commit is contained in:
Gregory Maxwell 2012-05-13 11:40:19 -04:00 committed by Jean-Marc Valin
parent efbb5ea401
commit 936f52ca0e
2 changed files with 8 additions and 0 deletions

View file

@ -32,6 +32,10 @@
#ifndef STACK_ALLOC_H
#define STACK_ALLOC_H
#if (!defined (VAR_ARRAYS) && !defined (USE_ALLOCA) && !defined (NONTHREADSAFE_PSEUDOSTACK))
#error "Opus requires one of VAR_ARRAYS, USE_ALLOCA, or NONTHREADSAFE_PSEUDOSTACK be defined to select the temporary allocation mode."
#endif
#ifdef USE_ALLOCA
# ifdef WIN32
# include <malloc.h>