From cfbbd9462707db9f7fde6b8f8adf8936d05cffe4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 25 Mar 2013 16:37:09 -0500 Subject: [svn-r23453] FIX plugin DLL decoration --- src/H5PLpublic.h | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index 6b17197..6a8a612 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -36,12 +36,40 @@ typedef enum H5PL_type_t { } H5PL_type_t; -/* plugins always export */ -#if defined (_MSC_VER) /* MSVC Compiler Case */ - #define H5PLUGIN_DLL __declspec(dllexport) -#elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ - #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) -#endif +#ifdef H5_BUILT_AS_DYNAMIC_LIB + + #if defined (hdf5_EXPORTS) + /* hdf5 library imports from plugin */ + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllimport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) + #endif + #else + /* plugins always export */ + #if defined (_MSC_VER) /* MSVC Compiler Case */ + #define H5PLUGIN_DLL __declspec(dllexport) + #elif (__GNUC__ >= 4) /* GCC 4.x has support for visibility options */ + #define H5PLUGIN_DLL __attribute__ ((visibility("default"))) + #endif + #endif + +#elif defined(H5_BUILT_AS_STATIC_LIB) + #define H5PLUGIN_DLL +#else + + #if defined(H5_HAVE_WIN32_API) + #if defined(_HDF5DLL_) + #pragma warning(disable: 4273) /* Disable the dll linkage warnings */ + #define H5PLUGIN_DLL __declspec(dllimport) + #elif defined(_HDF5USEDLL_) + #define H5PLUGIN_DLL __declspec(dllexport) + #endif /* _HDF5DLL_ */ + #else /*H5_HAVE_WIN32_API*/ + #define H5PLUGIN_DLL + #endif /*H5_HAVE_WIN32_API*/ + +#endif /* H5_BUILT_AS_xxx_LIB */ #ifdef __cplusplus extern "C" { -- cgit v0.12