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:
parent
efbb5ea401
commit
936f52ca0e
2 changed files with 8 additions and 0 deletions
|
@ -32,6 +32,10 @@
|
||||||
#ifndef STACK_ALLOC_H
|
#ifndef STACK_ALLOC_H
|
||||||
#define 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 USE_ALLOCA
|
||||||
# ifdef WIN32
|
# ifdef WIN32
|
||||||
# include <malloc.h>
|
# include <malloc.h>
|
||||||
|
|
|
@ -29,6 +29,10 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef OPUS_BUILD
|
||||||
|
#error "OPUS_BUILD _MUST_ be defined to build Opus and you probably want a decent config.h, see README for more details."
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include "celt.h"
|
#include "celt.h"
|
||||||
#include "opus.h"
|
#include "opus.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue