From 54d0a3694785431dee7a46cab56694cf6ba9bde2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 10 Sep 2015 15:39:44 -0500 Subject: [svn-r27753] Removed duplicated attribute macro checks. Moved canonical attribute macro checks from src/H5api_adapt.h to H5private.h, which is where they belong anyway. Tested on: h5committest (manually inspected for attribute warnings) --- src/H5api_adpt.h | 22 ---------------------- src/H5private.h | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index ab7287c..910bef9 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -21,28 +21,6 @@ #ifndef H5API_ADPT_H #define H5API_ADPT_H -/* - * Does the compiler support the __attribute__(()) syntax? It's no - * big deal if we don't. - * - * Note that Solaris Studio supports attribute, but does not support the - * attributes we use. - */ -#ifdef __cplusplus -# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ -# define H5_ATTR_UNUSED /*void*/ -# define H5_ATTR_NORETURN /*void*/ -#else /* __cplusplus */ -#if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C) -# define H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z))) -# define H5_ATTR_UNUSED __attribute__((unused)) -# define H5_ATTR_NORETURN __attribute__((noreturn)) -#else -# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ -# define H5_ATTR_UNUSED /*void*/ -# define H5_ATTR_NORETURN /*void*/ -#endif -#endif /* __cplusplus */ /* This will only be defined if HDF5 was built with CMake */ #ifdef H5_BUILT_AS_DYNAMIC_LIB diff --git a/src/H5private.h b/src/H5private.h index 5e968a0..738d4ff 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -288,12 +288,23 @@ /* * Does the compiler support the __attribute__(()) syntax? It's no * big deal if we don't. + * + * Note that Solaris Studio supports attribute, but does not support the + * attributes we use. */ #ifdef __cplusplus -# define __attribute__(X) /*void*/ +# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ +# define H5_ATTR_UNUSED /*void*/ +# define H5_ATTR_NORETURN /*void*/ #else /* __cplusplus */ -#ifndef H5_HAVE_ATTRIBUTE -# define __attribute__(X) /*void*/ +#if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C) +# define H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z))) +# define H5_ATTR_UNUSED __attribute__((unused)) +# define H5_ATTR_NORETURN __attribute__((noreturn)) +#else +# define H5_ATTR_FORMAT(X,Y,Z) /*void*/ +# define H5_ATTR_UNUSED /*void*/ +# define H5_ATTR_NORETURN /*void*/ #endif #endif /* __cplusplus */ -- cgit v0.12