diff options
author | Gregory Maxwell <greg@xiph.org> | 2013-10-18 02:56:52 +0400 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2013-10-28 21:18:54 +0400 |
commit | 7830cf1bd2c71bad9aa296254cf5c5f9842e8b8e (patch) | |
tree | 53f28e34554bee867a239849b96283bec549a607 /include | |
parent | 2891d852a38b3acb1810fad9f26ba7e0b181cfb2 (diff) |
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 'include')
-rw-r--r-- | include/opus_custom.h | 2 | ||||
-rw-r--r-- | include/opus_defines.h | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/include/opus_custom.h b/include/opus_custom.h index 6cf39630..dcfbcd8a 100644 --- a/include/opus_custom.h +++ b/include/opus_custom.h @@ -47,7 +47,7 @@ extern "C" { #else # define OPUS_CUSTOM_EXPORT # ifdef OPUS_BUILD -# define OPUS_CUSTOM_EXPORT_STATIC static inline +# define OPUS_CUSTOM_EXPORT_STATIC static OPUS_INLINE # else # define OPUS_CUSTOM_EXPORT_STATIC # endif diff --git a/include/opus_defines.h b/include/opus_defines.h index 3474e84c..af371b44 100644 --- a/include/opus_defines.h +++ b/include/opus_defines.h @@ -98,6 +98,18 @@ extern "C" { # define OPUS_RESTRICT restrict #endif +#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) +# if OPUS_GNUC_PREREQ(2,7) +# define OPUS_INLINE __inline__ +# elif (defined(_MSC_VER)) +# define OPUS_INLINE __inline +# else +# define OPUS_INLINE +# endif +#else +# define OPUS_INLINE inline +#endif + /**Warning attributes for opus functions * NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out * some paranoid null checks. */ |