summaryrefslogtreecommitdiff
path: root/src/glx/x11/glxclient.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/x11/glxclient.h')
-rw-r--r--src/glx/x11/glxclient.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glx/x11/glxclient.h b/src/glx/x11/glxclient.h
index 412511247e..b10c2ae17b 100644
--- a/src/glx/x11/glxclient.h
+++ b/src/glx/x11/glxclient.h
@@ -68,6 +68,23 @@
#include "glxextensions.h"
+
+/* If we build the library with gcc's -fvisibility=hidden flag, we'll
+ * use the PUBLIC macro to mark functions that are to be exported.
+ *
+ * We also need to define a USED attribute, so the optimizer doesn't
+ * inline a static function that we later use in an alias. - ajax
+ */
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
+# define PUBLIC __attribute__((visibility("default")))
+# define USED __attribute__((used))
+#else
+# define PUBLIC
+# define USED
+#endif
+
+
+
#define GLX_MAJOR_VERSION 1 /* current version numbers */
#define GLX_MINOR_VERSION 4