[libdrm:PATCH 2/2] libkms: Hide non-public symbols.
Cyril Brulebois
kibi at debian.org
Sat Mar 5 11:35:30 PST 2011
There's no reason to export those symbols, since they are only meant to
be used internally, so mark them as such. An alternative might be to use
a linker script.
Signed-off-by: Cyril Brulebois <kibi at debian.org>
---
libkms/intel.c | 2 +-
libkms/libkms.h | 10 ++++++++++
libkms/linux.c | 2 +-
libkms/nouveau.c | 2 +-
libkms/radeon.c | 2 +-
libkms/vmwgfx.c | 2 +-
6 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/libkms/intel.c b/libkms/intel.c
index 8b8249b..7b3a915 100644
--- a/libkms/intel.c
+++ b/libkms/intel.c
@@ -214,7 +214,7 @@ intel_bo_destroy(struct kms_bo *_bo)
return 0;
}
-int
+_X_HIDDEN int
intel_create(int fd, struct kms_driver **out)
{
struct kms_driver *kms;
diff --git a/libkms/libkms.h b/libkms/libkms.h
index 4664442..e4c84e7 100644
--- a/libkms/libkms.h
+++ b/libkms/libkms.h
@@ -71,4 +71,14 @@ int kms_bo_map(struct kms_bo *bo, void **out);
int kms_bo_unmap(struct kms_bo *bo);
int kms_bo_destroy(struct kms_bo **bo);
+/* Taken from X11/Xfuncproto.h, keeping only _X_HIDDEN to hide symbols
+ * which shouldn't be exported */
+#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(__CYGWIN__)
+# define _X_HIDDEN __attribute__((visibility("hidden")))
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+# define _X_HIDDEN __hidden
+#else /* not gcc >= 4 and not Sun Studio >= 8 */
+# define _X_HIDDEN
+#endif /* GNUC >= 4 */
+
#endif
diff --git a/libkms/linux.c b/libkms/linux.c
index fc4f205..9eab83d 100644
--- a/libkms/linux.c
+++ b/libkms/linux.c
@@ -213,7 +213,7 @@ linux_from_udev(int fd, struct kms_driver **out)
}
#endif
-int
+_X_HIDDEN int
linux_create(int fd, struct kms_driver **out)
{
if (!dumb_create(fd, out))
diff --git a/libkms/nouveau.c b/libkms/nouveau.c
index 0e24a15..16eec6d 100644
--- a/libkms/nouveau.c
+++ b/libkms/nouveau.c
@@ -196,7 +196,7 @@ nouveau_bo_destroy(struct kms_bo *_bo)
return 0;
}
-int
+_X_HIDDEN int
nouveau_create(int fd, struct kms_driver **out)
{
struct kms_driver *kms;
diff --git a/libkms/radeon.c b/libkms/radeon.c
index f5e382a..3bec92d 100644
--- a/libkms/radeon.c
+++ b/libkms/radeon.c
@@ -218,7 +218,7 @@ radeon_bo_destroy(struct kms_bo *_bo)
return 0;
}
-int
+_X_HIDDEN int
radeon_create(int fd, struct kms_driver **out)
{
struct kms_driver *kms;
diff --git a/libkms/vmwgfx.c b/libkms/vmwgfx.c
index d594b3b..bcf1b93 100644
--- a/libkms/vmwgfx.c
+++ b/libkms/vmwgfx.c
@@ -184,7 +184,7 @@ vmwgfx_bo_destroy(struct kms_bo *_bo)
return 0;
}
-int
+_X_HIDDEN int
vmwgfx_create(int fd, struct kms_driver **out)
{
struct kms_driver *kms;
--
1.7.4.1
More information about the dri-devel
mailing list