diff options
author | Timothy B. Terriberry <tterribe@xiph.org> | 2011-05-05 02:03:30 +0400 |
---|---|---|
committer | Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> | 2011-05-05 23:20:12 +0400 |
commit | 1a458862e3d58d965e9758b8594ddd076eebb5db (patch) | |
tree | 55cc0518e45912c1193b05f54390414656963674 | |
parent | 09c67660129f91f9a11e68589b5e96af290cbf5f (diff) |
Disable parentheses warnings automatically.
This ensures we don't have to rely on build-system support for
disabling these warnings in libcelt.
-rw-r--r-- | libcelt/arch.h | 16 | ||||
-rw-r--r-- | libcelt/entcode.c | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libcelt/arch.h b/libcelt/arch.h index 799aa27c..e4015f1f 100644 --- a/libcelt/arch.h +++ b/libcelt/arch.h @@ -36,6 +36,22 @@ #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__); diff --git a/libcelt/entcode.c b/libcelt/entcode.c index 0626e51a..27cac4bf 100644 --- a/libcelt/entcode.c +++ b/libcelt/entcode.c @@ -30,6 +30,7 @@ #endif #include "entcode.h" +#include "arch.h" |