From ef501166e68ab5662d70cefaa329f9c8af26eb36 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Fri, 6 Dec 2019 11:51:12 +0100 Subject: [PATCH] fix warning about multiple definition of dll_header --- libsrc/include/nginterface.h | 18 ++++++------------ nglib/nglib.h | 5 +++-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/libsrc/include/nginterface.h b/libsrc/include/nginterface.h index bbdd267c..c09f18f0 100644 --- a/libsrc/include/nginterface.h +++ b/libsrc/include/nginterface.h @@ -18,18 +18,12 @@ */ -#ifdef WIN32 - #if NGINTERFACE_EXPORTS || NGLIB_EXPORTS || nglib_EXPORTS - #define DLL_HEADER __declspec(dllexport) - #else - #define DLL_HEADER __declspec(dllimport) - #endif -#else - #if __GNUC__ >= 4 - #define DLL_HEADER __attribute__ ((visibility ("default"))) - #else - #define DLL_HEADER - #endif +#ifndef DLL_HEADER + #if NGINTERFACE_EXPORTS || NGLIB_EXPORTS || nglib_EXPORTS + #define DLL_HEADER NGCORE_API_EXPORT + #else + #define DLL_HEADER NGCORE_API_IMPORT + #endif #endif diff --git a/nglib/nglib.h b/nglib/nglib.h index 8a78da07..286db0cb 100644 --- a/nglib/nglib.h +++ b/nglib/nglib.h @@ -23,6 +23,7 @@ // Philippose - 14.02.2009 // Modifications for creating a DLL in Windows +#ifndef DLL_HEADER #ifdef WIN32 #ifdef NGLIB_EXPORTS || nglib_EXPORTS #define DLL_HEADER __declspec(dllexport) @@ -30,9 +31,9 @@ #define DLL_HEADER __declspec(dllimport) #endif #else - #define DLL_HEADER + #define DLL_HEADER __attribute__((visibility("default"))) +#endif #endif - // ** Constants used within Netgen *********************