summaryrefslogtreecommitdiff
path: root/include/zmq.h
diff options
context:
space:
mode:
authorMartin Lucina <mato@kotelna.sk>2010-11-25 17:12:31 +0100
committerMartin Sustrik <sustrik@250bpm.com>2010-11-25 17:12:31 +0100
commitc9584096e033850c77c4c3d4ee99e8073f7b26da (patch)
tree1c87497cffc99288743e21798b9ac452917f618d /include/zmq.h
parent734624be760b3c7942eb26bea77fca918cb1540d (diff)
Control symbol exports using -fvisibility
On systems using GCC 4.0 or newer which support symbol visibility in shared libraries, use -fvisibility=hidden and only export explict API functions defined in zmq.cpp. We do not enable -fvisibility on MinGW since this uses a separate mechanism (__declspec). Signed-off-by: Martin Lucina <mato@kotelna.sk>
Diffstat (limited to 'include/zmq.h')
-rw-r--r--include/zmq.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/zmq.h b/include/zmq.h
index c2efa07..7a63253 100644
--- a/include/zmq.h
+++ b/include/zmq.h
@@ -39,6 +39,9 @@ extern "C" {
# endif
#else
# define ZMQ_EXPORT
+# if defined __GNUC__ && __GNUC__ >= 4
+# pragma GCC visibility push(default)
+# endif
#endif
/******************************************************************************/
@@ -242,6 +245,11 @@ ZMQ_EXPORT int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout);
ZMQ_EXPORT int zmq_device (int device, void * insocket, void* outsocket);
+#undef ZMQ_EXPORT
+#if defined __GNUC__ && __GNUC__ >= 4 && !defined _WIN32
+# pragma GCC visibility pop
+#endif
+
#ifdef __cplusplus
}
#endif