diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index 1f42d94b1dd..67c1ffcebc0 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -179,7 +179,7 @@ #include "intern/math_base_inline.c" #endif -#ifdef __GNUC__ +#ifdef BLI_MATH_GCC_WARN_PRAGMA # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wredundant-decls" #endif @@ -222,7 +222,7 @@ extern double round(double x); double double_round(double x, int ndigits); -#ifdef __GNUC__ +#ifdef BLI_MATH_GCC_WARN_PRAGMA # pragma GCC diagnostic pop #endif diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h index 593aba75361..bc82b7e393b 100644 --- a/source/blender/blenlib/BLI_math_geom.h +++ b/source/blender/blenlib/BLI_math_geom.h @@ -40,7 +40,7 @@ extern "C" { #include "intern/math_geom_inline.c" #endif -#ifdef __GNUC__ +#ifdef BLI_MATH_GCC_WARN_PRAGMA # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wredundant-decls" #endif @@ -286,7 +286,7 @@ MINLINE int min_axis_v3(const float vec[3]); MINLINE int poly_to_tri_count(const int poly_count, const int corner_count); -#ifdef __GNUC__ +#ifdef BLI_MATH_GCC_WARN_PRAGMA # pragma GCC diagnostic pop #endif diff --git a/source/blender/blenlib/BLI_math_inline.h b/source/blender/blenlib/BLI_math_inline.h index 6dad44644f2..2bf3b9532dd 100644 --- a/source/blender/blenlib/BLI_math_inline.h +++ b/source/blender/blenlib/BLI_math_inline.h @@ -56,6 +56,11 @@ extern "C" { # define MALWAYS_INLINE #endif +/* gcc 4.6 (supports push/pop) */ +#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406)) +# define BLI_MATH_GCC_WARN_PRAGMA 1 +#endif + #ifdef __cplusplus } #endif diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index a4afb3b5612..c9ad19f74b4 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -42,7 +42,7 @@ extern "C" { /************************************* Init ***********************************/ -#ifdef __GNUC__ +#ifdef BLI_MATH_GCC_WARN_PRAGMA # pragma GCC diagnostic push # pragma GCC diagnostic ignored "-Wredundant-decls" #endif @@ -266,7 +266,7 @@ void fill_vn_i(int *array_tar, const int size, const int val); void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val); void fill_vn_fl(float *array_tar, const int size, const float val); -#ifdef __GNUC__ +#ifdef BLI_MATH_GCC_WARN_PRAGMA # pragma GCC diagnostic pop #endif