[gjs] Only use #pragma for ignoring diagnostics if GCC version supports it



commit a2589a1a55e9c1b0cdb0f60319ed460c3cb468ea
Author: Colin Walters <walters verbum org>
Date:   Mon Apr 22 18:27:54 2013 -0400

    Only use #pragma for ignoring diagnostics if GCC version supports it
    
    This syntax and version matches what GLib uses for
    G_GNUC_BEGIN_IGNORE_DEPRECATIONS.
    
    If we don't do this, gcc 4.4.7 from RHEL6 spams me.

 gjs/compat.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gjs/compat.h b/gjs/compat.h
index 5206b04..971899b 100644
--- a/gjs/compat.h
+++ b/gjs/compat.h
@@ -29,12 +29,16 @@
 #ifndef __GJS_COMPAT_H__
 #define __GJS_COMPAT_H__
 
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wstrict-prototypes"
-#pragma GCC diagnostic ignored "-Winvalid-offsetof"
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+_Pragma("GCC diagnostic push")
+_Pragma("GCC diagnostic ignored \"-Wstrict-prototypes\"")
+_Pragma("GCC diagnostic ignored \"-Winvalid-offsetof\"")
+#endif
 #include <jsapi.h>
 #include <jsdbgapi.h> // Needed by some bits
-#pragma GCC diagnostic pop
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+_Pragma("GCC diagnostic pop")
+#endif
 #include <glib.h>
 
 #include <gjs/jsapi-util.h>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]