[VDPAU] [PATCH 2/2] vdpau: do not export _vdp_DRI2* functions

Emil Velikov emil.l.velikov at gmail.com
Sat Jul 19 08:22:38 PDT 2014


Neither one is part of the public API, thus should never be used outside
of the library itself.

Add a PUBLIC and PRIVATE macros, that are used to annotate the function
visibility by setting the respective __attribute__((visibility("bla"))).

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/mesa_dri2.h | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/mesa_dri2.h b/src/mesa_dri2.h
index 09bde8c..0b7dbf1 100644
--- a/src/mesa_dri2.h
+++ b/src/mesa_dri2.h
@@ -37,17 +37,26 @@
 
 #include <X11/extensions/dri2tokens.h>
 
-extern Bool
+#if (defined(__GNUC__) && __GNUC__ >= 4)
+  #define PUBLIC  __attribute__ ((visibility("default")))
+  #define PRIVATE __attribute__ ((visibility("hidden")))
+#else
+  #define PUBLIC
+  #define PRIVATE
+#endif
+
+
+PRIVATE extern Bool
 _vdp_DRI2QueryExtension(Display * display, int *eventBase, int *errorBase);
 
-extern Bool
+PRIVATE extern Bool
 _vdp_DRI2QueryVersion(Display * display, int *major, int *minor);
 
-extern Bool
+PRIVATE extern Bool
 _vdp_DRI2Connect(Display * display, XID window, char **driverName,
                  char **deviceName);
 
-extern void
+PRIVATE extern void
 _vdp_DRI2RemoveExtension(Display * display);
 
 #endif
-- 
2.0.0



More information about the VDPAU mailing list