Disable parentheses warnings automatically.
authorTimothy B. Terriberry <tterribe@xiph.org>
Wed, 4 May 2011 22:03:30 +0000 (15:03 -0700)
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>
Thu, 5 May 2011 19:20:12 +0000 (15:20 -0400)
This ensures we don't have to rely on build-system support for
 disabling these warnings in libcelt.

libcelt/arch.h
libcelt/entcode.c

index 799aa27..e4015f1 100644 (file)
 
 #include "celt_types.h"
 
+# if !defined(__GNUC_PREREQ)
+#  if defined(__GNUC__)&&defined(__GNUC_MINOR__)
+#   define __GNUC_PREREQ(_maj,_min) \
+ ((__GNUC__<<16)+__GNUC_MINOR__>=((_maj)<<16)+(_min))
+#  else
+#   define __GNUC_PREREQ(_maj,_min) 0
+#  endif
+# endif
+
+# if defined(_MSC_VER)
+#  pragma warning(disable:4554)
+# endif
+# if __GNUC_PREREQ(4,2)
+#  pragma GCC diagnostic ignored "-Wparentheses"
+# endif
+
 #define CELT_SIG_SCALE 32768.f
 
 #define celt_fatal(str) _celt_fatal(str, __FILE__, __LINE__);
index 0626e51..27cac4b 100644 (file)
@@ -30,6 +30,7 @@
 #endif
 
 #include "entcode.h"
+#include "arch.h"