Determine if the visibility(default) attribute can be used by using only NSPR_4_6_BRANCH
authorwtchang%redhat.com
Tue, 03 Jan 2006 17:43:35 +0000
branchNSPR_4_6_BRANCH
changeset 3524 1ed5da9f6767021e1b0a01446d1e9966db81967e
parent 3515 f880a118573c0fb6dd748bee8a83ecf6aa9c9d8c
child 3525 937c413528e624f6018450bf592c22bee1902a3e
push idunknown
push userunknown
push dateunknown
bugs307168, 312361
Determine if the visibility(default) attribute can be used by using only the GCC version so that this public header does not depend on any macro the user needs to define. See Bugzilla bug 307168 comment 29 and bug 312361. Tag: NSPR_4_6_BRANCH
pr/include/prtypes.h
--- a/pr/include/prtypes.h
+++ b/pr/include/prtypes.h
@@ -173,17 +173,19 @@
 #define PR_EXTERN_DATA(__type) extern __type
 #define PR_IMPLEMENT_DATA(__type) __type
 #define PR_CALLBACK _Optlink
 #define PR_CALLBACK_DECL
 #define PR_STATIC_CALLBACK(__x) static __x PR_CALLBACK
 
 #else /* Unix */
 
-#ifdef HAVE_VISIBILITY_PRAGMA
+/* GCC 3.3 and later support the visibility attribute. */
+#if (__GNUC__ >= 4) || \
+    (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
 #define PR_VISIBILITY_DEFAULT __attribute__((visibility("default")))
 #else
 #define PR_VISIBILITY_DEFAULT
 #endif
 
 #define PR_EXPORT(__type) extern PR_VISIBILITY_DEFAULT __type
 #define PR_EXPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type
 #define PR_IMPORT(__type) extern PR_VISIBILITY_DEFAULT __type