summaryrefslogtreecommitdiff
path: root/celt/os_support.h
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2013-10-17 15:56:52 -0700
committerGregory Maxwell <greg@xiph.org>2013-10-28 10:18:54 -0700
commit7830cf1bd2c71bad9aa296254cf5c5f9842e8b8e (patch)
tree53f28e34554bee867a239849b96283bec549a607 /celt/os_support.h
parent2891d852a38b3acb1810fad9f26ba7e0b181cfb2 (diff)
downloadopus-7830cf1bd2c71bad9aa296254cf5c5f9842e8b8e.tar.gz
Replace "inline" with OPUS_INLINE.
Newer versions of MSVC are unhappy with the strategy of the build environment redefining "inline" (even though they don't support the actual keyword). Instead we define OPUS_INLINE to the right thing in opus_defines.h. This is the same approach we use for restrict.
Diffstat (limited to 'celt/os_support.h')
-rw-r--r--celt/os_support.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/celt/os_support.h b/celt/os_support.h
index 2484f0b2..5e47e3cf 100644
--- a/celt/os_support.h
+++ b/celt/os_support.h
@@ -35,13 +35,16 @@
# include "custom_support.h"
#endif
+#include "opus_types.h"
+#include "opus_defines.h"
+
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
/** Opus wrapper for malloc(). To do your own dynamic allocation, all you need to do is replace this function and opus_free */
#ifndef OVERRIDE_OPUS_ALLOC
-static inline void *opus_alloc (size_t size)
+static OPUS_INLINE void *opus_alloc (size_t size)
{
return malloc(size);
}
@@ -49,7 +52,7 @@ static inline void *opus_alloc (size_t size)
/** Same as celt_alloc(), except that the area is only needed inside a CELT call (might cause problem with wideband though) */
#ifndef OVERRIDE_OPUS_ALLOC_SCRATCH
-static inline void *opus_alloc_scratch (size_t size)
+static OPUS_INLINE void *opus_alloc_scratch (size_t size)
{
/* Scratch space doesn't need to be cleared */
return opus_alloc(size);
@@ -58,7 +61,7 @@ static inline void *opus_alloc_scratch (size_t size)
/** Opus wrapper for free(). To do your own dynamic allocation, all you need to do is replace this function and opus_alloc */
#ifndef OVERRIDE_OPUS_FREE
-static inline void opus_free (void *ptr)
+static OPUS_INLINE void opus_free (void *ptr)
{
free(ptr);
}