From 1a458862e3d58d965e9758b8594ddd076eebb5db Mon Sep 17 00:00:00 2001 From: "Timothy B. Terriberry" <tterribe@xiph.org> Date: Wed, 4 May 2011 15:03:30 -0700 Subject: [PATCH] Disable parentheses warnings automatically. This ensures we don't have to rely on build-system support for disabling these warnings in libcelt. --- libcelt/arch.h | 16 ++++++++++++++++ libcelt/entcode.c | 1 + 2 files changed, 17 insertions(+) diff --git a/libcelt/arch.h b/libcelt/arch.h index 799aa27c6..e4015f1f7 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 0626e51a3..27cac4bfe 100644 --- a/libcelt/entcode.c +++ b/libcelt/entcode.c @@ -30,6 +30,7 @@ #endif #include "entcode.h" +#include "arch.h" -- GitLab