summaryrefslogtreecommitdiffstats
path: root/src/H5public.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2014-03-16 03:13:52 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2014-03-16 03:13:52 (GMT)
commit288c7760a4a55d56df7a9019a8522625e305b9b7 (patch)
tree45f89de4d98a01416f27ada601a6d7fff6e49a82 /src/H5public.h
parentf5689224b5faaf01c02a1a4ae2a0a71b9f46e1d0 (diff)
downloadhdf5-288c7760a4a55d56df7a9019a8522625e305b9b7.zip
hdf5-288c7760a4a55d56df7a9019a8522625e305b9b7.tar.gz
hdf5-288c7760a4a55d56df7a9019a8522625e305b9b7.tar.bz2
[svn-r24803] Description:
Rename GCC_DIAG_OFF/ON macros to H5_GCC_DIAG_OFF/ON and move from src/H5private.h to src/H5public.h. Wrap typedef of hsize_t and hssize_t in DIAG_OFF(long-long) macros. Clean up a bunch of "macro '-' is unused" warnings. Tested on: Mac OSX/64 10.9.2 (amazon) w/gcc 4.8.2, C++, FORTRAN, parallel (too minor to require h5committest)
Diffstat (limited to 'src/H5public.h')
-rw-r--r--src/H5public.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/H5public.h b/src/H5public.h
index 544f7be..35207df 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -72,6 +72,25 @@
extern "C" {
#endif
+/* Macros for enabling/disabling particular GCC warnings */
+/* (see the following web-sites for more info:
+ * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html
+ * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas
+ */
+/* These pragmas are only implemented usefully in gcc 4.6+ */
+#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406
+ #define H5_GCC_DIAG_STR(s) #s
+ #define H5_GCC_DIAG_JOINSTR(x,y) H5_GCC_DIAG_STR(x ## y)
+ #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma (#x)
+ #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x)
+
+ #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR(-W,x))
+ #define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop)
+#else
+ #define H5_GCC_DIAG_OFF(x)
+ #define H5_GCC_DIAG_ON(x)
+#endif
+
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
@@ -148,8 +167,10 @@ typedef long long ssize_t;
* type.
*/
#if H5_SIZEOF_LONG_LONG >= 8
+H5_GCC_DIAG_OFF(long-long)
typedef unsigned long long hsize_t;
typedef signed long long hssize_t;
+H5_GCC_DIAG_ON(long-long)
# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG
# define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG
#else