diff options
author | Gregory Maxwell <greg@xiph.org> | 2012-07-18 12:12:35 -0400 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2012-07-18 12:12:35 -0400 |
commit | de0b5324b687c9e9a33722d84151de08ee7f82a9 (patch) | |
tree | 4d80ef9939e11bf1796dc50949c9790cb77930c9 /include/opus_defines.h | |
parent | 31e8a845923ace3cb818dd12839188cf3f29af80 (diff) | |
download | opus-de0b5324b687c9e9a33722d84151de08ee7f82a9.tar.gz |
Replace C99 restrict keyword with OPUS_RESTRICT.
We had previously advised people to -Drestrict on
non-C99 compilers, but this creates problems for
some of the MSVC headers. Instead this just
uses a macro and defines it sanely.
Diffstat (limited to 'include/opus_defines.h')
-rw-r--r-- | include/opus_defines.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/opus_defines.h b/include/opus_defines.h index aad47fc4..a16bd648 100644 --- a/include/opus_defines.h +++ b/include/opus_defines.h @@ -84,6 +84,18 @@ extern "C" { # endif # endif +#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) +# if OPUS_GNUC_PREREQ(3,0) +# define OPUS_RESTRICT __restrict__ +# elif (_MSC_VER >= 1400) +# define OPUS_RESTRICT __restrict +# else +# define OPUS_RESTRICT +# endif +#else +# define OPUS_RESTRICT restrict +#endif + /**Warning attributes for opus functions * NONNULL is not used in OPUS_BUILD to avoid the compiler optimizing out * some paranoid null checks. */ |