From ccdcbec6350863cd4d85f8ed29404f594ce91277 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Tue, 31 Mar 2015 14:54:31 -0500 Subject: [svn-r26678] add ifdef checks and setting for __attribute__ in a public place to allow usage in public routines. --- src/H5Eprivate.h | 2 +- src/H5api_adpt.h | 7 +++++++ src/H5private.h | 7 ++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index 0e6def6..2065b08 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -186,7 +186,7 @@ H5_DLL herr_t H5E_init(void); H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); H5_DLL herr_t H5E_printf_stack(H5E_t *estack, const char *file, const char *func, - unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...); + unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...)__attribute__((format (printf, 8, 9))); H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(hbool_t is_api); diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index 9b00bd9..98b0045 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -24,6 +24,13 @@ /* This will only be defined if HDF5 was built with CMake */ #ifdef H5_BUILT_AS_DYNAMIC_LIB +#ifdef __cplusplus +#define __attribute__(X) /*void*/ +#endif /* __cplusplus */ +#ifndef H5_HAVE_ATTRIBUTE +#define __attribute__(X) /*void*/ +#endif /* H5_HAVE_ATTRIBUTE */ + #if defined(hdf5_EXPORTS) #if defined (_MSC_VER) /* MSVC Compiler Case */ #define H5_DLL __declspec(dllexport) diff --git a/src/H5private.h b/src/H5private.h index 1164a2d..d1bbc24 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -275,12 +275,10 @@ #endif /* - * Does the compiler support the __attribute__(()) syntax? This is how gcc - * suppresses warnings about unused function arguments. It's no big deal if - * we don't. + * Does the compiler support the __attribute__(()) syntax? It's no + * big deal if we don't. */ #ifdef __cplusplus -# define __attribute__(X) /*void*/ # define UNUSED /*void*/ # define NORETURN /*void*/ #else /* __cplusplus */ @@ -288,7 +286,6 @@ # define UNUSED __attribute__((unused)) # define NORETURN __attribute__((noreturn)) #else -# define __attribute__(X) /*void*/ # define UNUSED /*void*/ # define NORETURN /*void*/ #endif -- cgit v0.12