From 4c0bbc0604c99a077aff91e10948befc073c4640 Mon Sep 17 00:00:00 2001 From: Andreas Schuh Date: Fri, 9 Nov 2018 17:46:42 +0000 Subject: [PATCH] fix: Use 'default' visibility for GCC --- src/config.h | 2 ++ src/gflags_declare.h.in | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/config.h b/src/config.h index b90b7e6..c33d207 100644 --- a/src/config.h +++ b/src/config.h @@ -36,6 +36,8 @@ #ifndef GFLAGS_DLL_DECL # if GFLAGS_IS_A_DLL && defined(_MSC_VER) # define GFLAGS_DLL_DECL __declspec(dllexport) +# elif defined(__GNUC__) && __GNUC__ >= 4 +# define GFLAGS_DLL_DECL __attribute__((visibility("default"))) # else # define GFLAGS_DLL_DECL # endif diff --git a/src/gflags_declare.h.in b/src/gflags_declare.h.in index 752a34d..ab7bd24 100644 --- a/src/gflags_declare.h.in +++ b/src/gflags_declare.h.in @@ -58,6 +58,8 @@ #ifndef GFLAGS_DLL_DECL # if GFLAGS_IS_A_DLL && defined(_MSC_VER) # define GFLAGS_DLL_DECL __declspec(dllimport) +# elif defined(__GNUC__) && __GNUC__ >= 4 +# define GFLAGS_DLL_DECL __attribute__((visibility("default"))) # else # define GFLAGS_DLL_DECL # endif @@ -67,6 +69,8 @@ #ifndef GFLAGS_DLL_DECLARE_FLAG # if GFLAGS_IS_A_DLL && defined(_MSC_VER) # define GFLAGS_DLL_DECLARE_FLAG __declspec(dllimport) +# elif defined(__GNUC__) && __GNUC__ >= 4 +# define GFLAGS_DLL_DECLARE_FLAG __attribute__((visibility("default"))) # else # define GFLAGS_DLL_DECLARE_FLAG # endif