summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libopus/celt/stack_alloc.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/stack_alloc.h')
-rw-r--r--lib/rbcodec/codecs/libopus/celt/stack_alloc.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/stack_alloc.h b/lib/rbcodec/codecs/libopus/celt/stack_alloc.h
index 1c093a8cdc..316a6ce12c 100644
--- a/lib/rbcodec/codecs/libopus/celt/stack_alloc.h
+++ b/lib/rbcodec/codecs/libopus/celt/stack_alloc.h
@@ -32,6 +32,9 @@
32#ifndef STACK_ALLOC_H 32#ifndef STACK_ALLOC_H
33#define STACK_ALLOC_H 33#define STACK_ALLOC_H
34 34
35#include "opus_types.h"
36#include "opus_defines.h"
37
35#if (!defined (VAR_ARRAYS) && !defined (USE_ALLOCA) && !defined (NONTHREADSAFE_PSEUDOSTACK)) 38#if (!defined (VAR_ARRAYS) && !defined (USE_ALLOCA) && !defined (NONTHREADSAFE_PSEUDOSTACK))
36#error "Opus requires one of VAR_ARRAYS, USE_ALLOCA, or NONTHREADSAFE_PSEUDOSTACK be defined to select the temporary allocation mode." 39#error "Opus requires one of VAR_ARRAYS, USE_ALLOCA, or NONTHREADSAFE_PSEUDOSTACK be defined to select the temporary allocation mode."
37#endif 40#endif
@@ -92,6 +95,8 @@
92#define SAVE_STACK 95#define SAVE_STACK
93#define RESTORE_STACK 96#define RESTORE_STACK
94#define ALLOC_STACK 97#define ALLOC_STACK
98/* C99 does not allow VLAs of size zero */
99#define ALLOC_NONE 1
95 100
96#elif defined(USE_ALLOCA) 101#elif defined(USE_ALLOCA)
97 102
@@ -106,6 +111,7 @@
106#define SAVE_STACK 111#define SAVE_STACK
107#define RESTORE_STACK 112#define RESTORE_STACK
108#define ALLOC_STACK 113#define ALLOC_STACK
114#define ALLOC_NONE 0
109 115
110#else 116#else
111 117
@@ -143,6 +149,7 @@ extern char *global_stack_top;
143#define VARDECL(type, var) type *var 149#define VARDECL(type, var) type *var
144#define ALLOC(var, size, type) var = PUSH(global_stack, size, type) 150#define ALLOC(var, size, type) var = PUSH(global_stack, size, type)
145#define SAVE_STACK char *_saved_stack = global_stack; 151#define SAVE_STACK char *_saved_stack = global_stack;
152#define ALLOC_NONE 0
146 153
147#endif /* VAR_ARRAYS */ 154#endif /* VAR_ARRAYS */
148 155
@@ -159,7 +166,7 @@ extern char *global_stack_top;
159 166
160#else 167#else
161 168
162static inline int _opus_false(void) {return 0;} 169static OPUS_INLINE int _opus_false(void) {return 0;}
163#define OPUS_CHECK_ARRAY(ptr, len) _opus_false() 170#define OPUS_CHECK_ARRAY(ptr, len) _opus_false()
164#define OPUS_CHECK_VALUE(value) _opus_false() 171#define OPUS_CHECK_VALUE(value) _opus_false()
165#define OPUS_PRINT_INT(value) do{}while(0) 172#define OPUS_PRINT_INT(value) do{}while(0)