From e507e05b5c39dc42ae9c9c7ce52c8f6ef70eadbb Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Fri, 15 Dec 2017 15:46:51 +0000 Subject: [PATCH] oslibs, codecs, opus/opus_defines.h update: restrict is broken with gcc < 4, don't use: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6392 git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1541 af15c1b1-3010-417e-b628-4374ebc0bcbd --- MacOSX/codecs/include/opus/opus_defines.h | 6 +++++- Windows/codecs/include/opus/opus_defines.h | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/MacOSX/codecs/include/opus/opus_defines.h b/MacOSX/codecs/include/opus/opus_defines.h index c42d301e..4785d66c 100644 --- a/MacOSX/codecs/include/opus/opus_defines.h +++ b/MacOSX/codecs/include/opus/opus_defines.h @@ -86,7 +86,11 @@ extern "C" { # endif # endif -#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) +#if (defined(__GNUC__) && (__GNUC__ < 4)) +/* __restrict is broken with gcc < 4.0 + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6392 */ +# define OPUS_RESTRICT +#elif (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) # if OPUS_GNUC_PREREQ(3,0) # define OPUS_RESTRICT __restrict__ # elif (defined(_MSC_VER) && _MSC_VER >= 1400) diff --git a/Windows/codecs/include/opus/opus_defines.h b/Windows/codecs/include/opus/opus_defines.h index c42d301e..f8b270bb 100644 --- a/Windows/codecs/include/opus/opus_defines.h +++ b/Windows/codecs/include/opus/opus_defines.h @@ -86,7 +86,17 @@ extern "C" { # endif # endif -#if (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) +#if defined(__WATCOMC__) +# if (__WATCOMC__ >= 1250) +# define OPUS_RESTRICT __restrict +# else +# define OPUS_RESTRICT +# endif +#elif (defined(__GNUC__) && (__GNUC__ < 4)) +/* __restrict is broken with gcc < 4.0 + https://gcc.gnu.org/bugzilla/show_bug.cgi?id=6392 */ +# define OPUS_RESTRICT +#elif (!defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L) ) # if OPUS_GNUC_PREREQ(3,0) # define OPUS_RESTRICT __restrict__ # elif (defined(_MSC_VER) && _MSC_VER >= 1400)