diff include/freeDiameter/libfdproto.h @ 1034:f4a73a991623

Fix warning on old GCC versions
author Sebastien Decugis <sdecugis@freediameter.net>
date Wed, 17 Apr 2013 18:38:12 +0800
parents 000e1904074c
children cceb552b9b54
line wrap: on
line diff
--- a/include/freeDiameter/libfdproto.h	Tue Apr 16 11:45:52 2013 +0800
+++ b/include/freeDiameter/libfdproto.h	Wed Apr 17 18:38:12 2013 +0800
@@ -89,6 +89,23 @@
 #define _ATTRIBUTE_PRINTFLIKE_(_f,_v) __attribute__ ((format (printf, _f, _v)))
 #endif /* SWIG */
 
+/* Remove some deprecated warnings from some gnutls versions, when possible */
+#if defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 405
+# define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x)
+# define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
+# if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
+#  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) \
+     GCC_DIAG_PRAGMA(ignored x)
+#  define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop)
+# else
+#  define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(ignored x)
+#  define GCC_DIAG_ON(x)  GCC_DIAG_PRAGMA(warning x)
+# endif
+#else
+# define GCC_DIAG_OFF(x)
+# define GCC_DIAG_ON(x)
+#endif
+
 /*============================================================*/
 /*                       CONSTANTS                            */
 /*============================================================*/
"Welcome to our mercurial repository"