Determine if the visibility(default) attribute can be used by using only MOZILLA_1_8_BRANCH
authorwtchang%redhat.com
Thu, 05 Jan 2006 21:31:25 +0000
branchMOZILLA_1_8_BRANCH
changeset 3530 5e3d06ed14cee5c1e13b26497355c235ac254f64
parent 3528 dbeb5c0b4c95c781b64ae5aabb99215ac72ed457
child 3531 150966f634b82f3673af4cb338a35e1002d1b29e
push idunknown
push userunknown
push dateunknown
bugs312361, 307168
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 312361 and bug 307168 comment 29. r=bryner. a=dveditz for mozilla1.8.1. Tag: MOZILLA_1_8_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