summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorAdam Jackson <ajax@freedesktop.org>2004-12-15 17:18:06 +0000
committerAdam Jackson <ajax@freedesktop.org>2004-12-15 17:18:06 +0000
commit489ccef3982267b0d35c8548921f58d553c25a3a (patch)
treea2119f8246f5a9f84a0969b18a2020f6cf07f0f1 /src/mesa/main
parent5566127701df5c97aca94dd99b066f94943ea969 (diff)
Fix up glx/x11 to work when built with -fvisibility=hidden.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/glheader.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 3cf9e6c867..092d014e8e 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -281,11 +281,16 @@ typedef GLushort GLhalfARB;
/* 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