From patchwork Sat Mar 5 19:35:29 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyril Brulebois X-Patchwork-Id: 613301 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p26AfklQ017388 for ; Sun, 6 Mar 2011 10:42:07 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C46F9EF75 for ; Sun, 6 Mar 2011 02:41:46 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from glenfiddich.ikibiki.org (glenfiddich.ikibiki.org [88.191.124.82]) by gabe.freedesktop.org (Postfix) with ESMTP id ED1D59E7AF for ; Sat, 5 Mar 2011 11:35:32 -0800 (PST) Received: from home.ikibiki.org ([88.164.242.219] helo=kitty) by glenfiddich.ikibiki.org with esmtp (Exim 4.69) (envelope-from ) id 1PvxGG-0003nY-Hw; Sat, 05 Mar 2011 20:35:32 +0100 Received: from kibi by kitty with local (Exim 4.72) (envelope-from ) id 1PvxGG-0000LL-6U; Sat, 05 Mar 2011 20:35:32 +0100 From: Cyril Brulebois To: dri-devel@lists.freedesktop.org Subject: [libdrm:PATCH 1/2] radeon: Hide non-public symbols. Date: Sat, 5 Mar 2011 20:35:29 +0100 Message-Id: <1299353730-1294-1-git-send-email-kibi@debian.org> X-Mailer: git-send-email 1.7.2.3 X-Mailman-Approved-At: Sun, 06 Mar 2011 02:38:47 -0800 Cc: Cyril Brulebois X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 06 Mar 2011 10:42:07 +0000 (UTC) diff --git a/radeon/bof.c b/radeon/bof.c index 0598cc6..7d178cb 100644 --- a/radeon/bof.c +++ b/radeon/bof.c @@ -48,7 +48,7 @@ static int bof_entry_grow(bof_t *bof) /* * object */ -bof_t *bof_object(void) +_X_HIDDEN bof_t *bof_object(void) { bof_t *object; @@ -61,7 +61,7 @@ bof_t *bof_object(void) return object; } -bof_t *bof_object_get(bof_t *object, const char *keyname) +_X_HIDDEN bof_t *bof_object_get(bof_t *object, const char *keyname) { unsigned i; @@ -73,7 +73,7 @@ bof_t *bof_object_get(bof_t *object, const char *keyname) return NULL; } -int bof_object_set(bof_t *object, const char *keyname, bof_t *value) +_X_HIDDEN int bof_object_set(bof_t *object, const char *keyname, bof_t *value) { bof_t *key; int r; @@ -97,7 +97,7 @@ int bof_object_set(bof_t *object, const char *keyname, bof_t *value) /* * array */ -bof_t *bof_array(void) +_X_HIDDEN bof_t *bof_array(void) { bof_t *array = bof_object(); @@ -108,7 +108,7 @@ bof_t *bof_array(void) return array; } -int bof_array_append(bof_t *array, bof_t *value) +_X_HIDDEN int bof_array_append(bof_t *array, bof_t *value) { int r; if (array->type != BOF_TYPE_ARRAY) @@ -122,14 +122,14 @@ int bof_array_append(bof_t *array, bof_t *value) return 0; } -bof_t *bof_array_get(bof_t *bof, unsigned i) +_X_HIDDEN bof_t *bof_array_get(bof_t *bof, unsigned i) { if (!bof_is_array(bof) || i >= bof->array_size) return NULL; return bof->array[i]; } -unsigned bof_array_size(bof_t *bof) +_X_HIDDEN unsigned bof_array_size(bof_t *bof) { if (!bof_is_array(bof)) return 0; @@ -139,7 +139,7 @@ unsigned bof_array_size(bof_t *bof) /* * blob */ -bof_t *bof_blob(unsigned size, void *value) +_X_HIDDEN bof_t *bof_blob(unsigned size, void *value) { bof_t *blob = bof_object(); @@ -157,14 +157,14 @@ bof_t *bof_blob(unsigned size, void *value) return blob; } -unsigned bof_blob_size(bof_t *bof) +_X_HIDDEN unsigned bof_blob_size(bof_t *bof) { if (!bof_is_blob(bof)) return 0; return bof->size - 12; } -void *bof_blob_value(bof_t *bof) +_X_HIDDEN void *bof_blob_value(bof_t *bof) { if (!bof_is_blob(bof)) return NULL; @@ -174,7 +174,7 @@ void *bof_blob_value(bof_t *bof) /* * string */ -bof_t *bof_string(const char *value) +_X_HIDDEN bof_t *bof_string(const char *value) { bof_t *string = bof_object(); @@ -195,7 +195,7 @@ bof_t *bof_string(const char *value) /* * int32 */ -bof_t *bof_int32(int32_t value) +_X_HIDDEN bof_t *bof_int32(int32_t value) { bof_t *int32 = bof_object(); @@ -213,7 +213,7 @@ bof_t *bof_int32(int32_t value) return int32; } -int32_t bof_int32_value(bof_t *bof) +_X_HIDDEN int32_t bof_int32_value(bof_t *bof) { return *((uint32_t*)bof->value); } @@ -271,7 +271,7 @@ static void bof_print_rec(bof_t *bof, int level, int entry) } } -void bof_print(bof_t *bof) +_X_HIDDEN void bof_print(bof_t *bof) { bof_print_rec(bof, 0, 0); } @@ -333,7 +333,7 @@ out_err: return -EINVAL; } -bof_t *bof_load_file(const char *filename) +_X_HIDDEN bof_t *bof_load_file(const char *filename) { bof_t *root = bof_object(); int r; @@ -369,12 +369,12 @@ out_err: return NULL; } -void bof_incref(bof_t *bof) +_X_HIDDEN void bof_incref(bof_t *bof) { bof->refcount++; } -void bof_decref(bof_t *bof) +_X_HIDDEN void bof_decref(bof_t *bof) { unsigned i; @@ -436,7 +436,7 @@ static int bof_file_write(bof_t *bof, FILE *file) return 0; } -int bof_dump_file(bof_t *bof, const char *filename) +_X_HIDDEN int bof_dump_file(bof_t *bof, const char *filename) { unsigned i; int r = 0; diff --git a/radeon/bof.h b/radeon/bof.h index 014affb..14cf7e5 100644 --- a/radeon/bof.h +++ b/radeon/bof.h @@ -87,4 +87,14 @@ static inline int bof_is_int32(bof_t *bof){return (bof->type == BOF_TYPE_INT32); static inline int bof_is_array(bof_t *bof){return (bof->type == BOF_TYPE_ARRAY);} static inline int bof_is_string(bof_t *bof){return (bof->type == BOF_TYPE_STRING);} +/* 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