Commit 5146a416 authored by Kirill Smelkov's avatar Kirill Smelkov

libgolang: Provide DSO_EXPORT/DSO_IMPORT macros for other libraries

In the next patch we are going to move PyFunc from time.pyx into shared
library. Before doing that let's provide DSO visibility macros from
libgolang.h to offload other libraries from duplicating dance on how to
mark symbols visibility properly depending on compiler/OS.
parent 47fac0a9
...@@ -102,15 +102,20 @@ ...@@ -102,15 +102,20 @@
// DSO symbols visibility (based on https://gcc.gnu.org/wiki/Visibility) // DSO symbols visibility (based on https://gcc.gnu.org/wiki/Visibility)
#if defined _WIN32 || defined __CYGWIN__ #if defined _WIN32 || defined __CYGWIN__
#ifdef BUILDING_LIBGOLANG #define LIBGOLANG_DSO_EXPORT __declspec(dllexport)
#define LIBGOLANG_API __declspec(dllexport) #define LIBGOLANG_DSO_IMPORT __declspec(dllimport)
#else
#define LIBGOLANG_API __declspec(dllimport)
#endif
#elif __GNUC__ >= 4 #elif __GNUC__ >= 4
#define LIBGOLANG_API __attribute__ ((visibility ("default"))) #define LIBGOLANG_DSO_EXPORT __attribute__ ((visibility ("default")))
#define LIBGOLANG_DSO_IMPORT __attribute__ ((visibility ("default")))
#else #else
#define LIBGOLANG_API #define LIBGOLANG_DSO_EXPORT
#define LIBGOLANG_DSO_IMPORT
#endif
#if BUILDING_LIBGOLANG
# define LIBGOLANG_API LIBGOLANG_DSO_EXPORT
#else
# define LIBGOLANG_API LIBGOLANG_DSO_IMPORT
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment