diff --git a/libfaad2/common.h b/libfaad2/common.h index 59df8c0a5d..73955565d5 100644 --- a/libfaad2/common.h +++ b/libfaad2/common.h @@ -305,7 +305,7 @@ char *strchr(), *strrchr(); } - #if defined(_WIN32) && !defined(__MINGW32__) && !HAVE_LRINTF + #if defined(_WIN32) && !defined(__MINGW32__) #define HAS_LRINTF static INLINE int lrintf(float f) { @@ -317,7 +317,7 @@ char *strchr(), *strrchr(); } return i; } - #elif (defined(__i386__) && defined(__GNUC__)) && !HAVE_LRINTF + #elif (defined(__i386__) && defined(__GNUC__)) && __STDC_VERSION__ < 199901L #define HAS_LRINTF // from http://www.stereopsis.com/FPU.html static INLINE int lrintf(float f) @@ -348,7 +348,7 @@ char *strchr(), *strrchr(); #include -#if HAVE_LRINTF +#ifdef HAVE_LRINTF # define HAS_LRINTF # define _ISOC9X_SOURCE 1 # define _ISOC99_SOURCE 1 diff --git a/libfaad2/local_changes.diff b/libfaad2/local_changes.diff index f06259df3a..30b3bb74ba 100644 --- a/libfaad2/local_changes.diff +++ b/libfaad2/local_changes.diff @@ -71,34 +71,23 @@ #define ARCH_IS_BIG_ENDIAN #endif -@@ -289,7 +305,7 @@ - } - - -- #if defined(_WIN32) && !defined(__MINGW32__) -+ #if defined(_WIN32) && !defined(__MINGW32__) && !HAVE_LRINTF - #define HAS_LRINTF - static INLINE int lrintf(float f) - { -@@ -301,7 +317,7 @@ +@@ -317,7 +317,7 @@ } return i; } - #elif (defined(__i386__) && defined(__GNUC__)) -+ #elif (defined(__i386__) && defined(__GNUC__)) && !HAVE_LRINTF ++ #elif (defined(__i386__) && defined(__GNUC__)) && __STDC_VERSION__ < 199901L #define HAS_LRINTF // from http://www.stereopsis.com/FPU.html static INLINE int lrintf(float f) -@@ -330,6 +346,8 @@ +@@ -330,5 +346,7 @@ #else +#include + --#ifdef HAVE_LRINTF -+#if HAVE_LRINTF + #ifdef HAVE_LRINTF # define HAS_LRINTF - # define _ISOC9X_SOURCE 1 @@ -338,8 +356,6 @@ # define __USE_ISOC99 1 #endif