All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Brulebois <kibi@debian.org>
To: dri-devel@lists.freedesktop.org
Cc: Cyril Brulebois <kibi@debian.org>
Subject: [libdrm:PATCH 2/2] libkms: Hide non-public symbols.
Date: Sat,  5 Mar 2011 20:35:30 +0100	[thread overview]
Message-ID: <1299353730-1294-2-git-send-email-kibi@debian.org> (raw)
In-Reply-To: <1299353730-1294-1-git-send-email-kibi@debian.org>

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@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

  reply	other threads:[~2011-03-05 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-05 19:35 [libdrm:PATCH 1/2] radeon: Hide non-public symbols Cyril Brulebois
2011-03-05 19:35 ` Cyril Brulebois [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-03-05 19:09 Cyril Brulebois
2011-03-05 19:09 ` [libdrm:PATCH 2/2] libkms: " Cyril Brulebois

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1299353730-1294-2-git-send-email-kibi@debian.org \
    --to=kibi@debian.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.