diff options
-rw-r--r-- | Makefile.draft | 4 | ||||
-rw-r--r-- | celt/float_cast.h | 5 | ||||
-rw-r--r-- | src/test_opus.c | 1 |
3 files changed, 7 insertions, 3 deletions
diff --git a/Makefile.draft b/Makefile.draft index f75b05ce..d2f307e1 100644 --- a/Makefile.draft +++ b/Makefile.draft @@ -12,8 +12,10 @@ CFLAGS += -DUSE_ALLOCA # These options affect performance # HAVE_LRINTF: Use C99 intrinsics to speed up float-to-int conversion -# restrict: Don't use the 'restrict' optimization (for pre-C99 compilers) +# inline: Don't use the 'inline' keyword (for ANSI C compilers) +# restrict: Don't use the 'restrict' keyword (for pre-C99 compilers) #CFLAGS += -DHAVE_LRINTF +#CFLAGS += -Dinline= CFLAGS += -Drestrict= ###################### END OF OPTIONS ###################### diff --git a/celt/float_cast.h b/celt/float_cast.h index b3670f0b..1b3f1991 100644 --- a/celt/float_cast.h +++ b/celt/float_cast.h @@ -115,10 +115,11 @@ #else -#ifdef __GNUC__ /* supported by gcc, but not by all other compilers*/ +#if (defined(__GNUC__) && defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) + /* supported by gcc in C99 mode, but not by all other compilers */ #warning "Don't have the functions lrint() and lrintf ()." #warning "Replacing these functions with a standard C cast." -#endif /* __GNUC__ */ +#endif /* __STDC_VERSION__ >= 199901L */ #include <math.h> #define float2int(flt) ((int)(floor(.5+flt))) #endif diff --git a/src/test_opus.c b/src/test_opus.c index 27e315a5..c0d5d486 100644 --- a/src/test_opus.c +++ b/src/test_opus.c @@ -65,6 +65,7 @@ void print_usage( char* argv[] ) #ifdef _WIN32 # define STR_CASEINSENSITIVE_COMPARE(x, y) _stricmp(x, y) #else +# include <strings.h> # define STR_CASEINSENSITIVE_COMPARE(x, y) strcasecmp(x, y) #endif |