diff --git a/mozilla/gfx/public/nsDeviceContext.h b/mozilla/gfx/public/nsDeviceContext.h index 26d5a47ab8c..bd229d07fcd 100644 --- a/mozilla/gfx/public/nsDeviceContext.h +++ b/mozilla/gfx/public/nsDeviceContext.h @@ -80,7 +80,7 @@ protected: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class NS_GFX DeviceContextImpl : public nsIDeviceContext, public nsIObserver, @@ -185,6 +185,6 @@ public: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif /* nsDeviceContext_h___ */ diff --git a/mozilla/gfx/src/nsPrintOptionsImpl.h b/mozilla/gfx/src/nsPrintOptionsImpl.h index 1b59c6d8306..7a8112839b8 100644 --- a/mozilla/gfx/src/nsPrintOptionsImpl.h +++ b/mozilla/gfx/src/nsPrintOptionsImpl.h @@ -32,7 +32,7 @@ //class nsIPrintSettings; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT //***************************************************************************** //*** nsPrintOptions @@ -80,6 +80,6 @@ protected: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif /* nsPrintOptions_h__ */ diff --git a/mozilla/gfx/src/nsPrintSession.h b/mozilla/gfx/src/nsPrintSession.h index 48d58bff7fa..4b0f43e99ef 100644 --- a/mozilla/gfx/src/nsPrintSession.h +++ b/mozilla/gfx/src/nsPrintSession.h @@ -49,7 +49,7 @@ //***************************************************************************** #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class NS_GFX nsPrintSession : public nsIPrintSession, public nsSupportsWeakReference @@ -65,6 +65,6 @@ public: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif // nsPrintSession_h__ diff --git a/mozilla/gfx/src/nsPrintSettingsImpl.h b/mozilla/gfx/src/nsPrintSettingsImpl.h index e149374c344..25e96258e29 100644 --- a/mozilla/gfx/src/nsPrintSettingsImpl.h +++ b/mozilla/gfx/src/nsPrintSettingsImpl.h @@ -35,7 +35,7 @@ //***************************************************************************** #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class NS_GFX nsPrintSettings : public nsIPrintSettings { @@ -116,6 +116,6 @@ protected: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif /* nsPrintSettings_h__ */ diff --git a/mozilla/gfx/src/nsRenderingContextImpl.h b/mozilla/gfx/src/nsRenderingContextImpl.h index 29c333c75cf..67081e01aa4 100644 --- a/mozilla/gfx/src/nsRenderingContextImpl.h +++ b/mozilla/gfx/src/nsRenderingContextImpl.h @@ -52,7 +52,7 @@ typedef struct { } Edge; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class nsRenderingContextImpl : public nsIRenderingContext { @@ -211,7 +211,7 @@ private: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN /** --------------------------------------------------- * Class QBezierCurve, a quadratic bezier curve diff --git a/mozilla/mailnews/base/util/nsMsgDBFolder.h b/mozilla/mailnews/base/util/nsMsgDBFolder.h index dbc26a0edb7..0f0d5322246 100644 --- a/mozilla/mailnews/base/util/nsMsgDBFolder.h +++ b/mozilla/mailnews/base/util/nsMsgDBFolder.h @@ -66,7 +66,7 @@ class nsICollation; */ #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class NS_MSG_BASE nsMsgDBFolder: public nsRDFResource, public nsSupportsWeakReference, @@ -251,6 +251,6 @@ protected: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif diff --git a/mozilla/mailnews/base/util/nsMsgIncomingServer.h b/mozilla/mailnews/base/util/nsMsgIncomingServer.h index d05515bc0fc..928276ba492 100644 --- a/mozilla/mailnews/base/util/nsMsgIncomingServer.h +++ b/mozilla/mailnews/base/util/nsMsgIncomingServer.h @@ -62,7 +62,7 @@ class nsIMsgProtocolInfo; */ #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class NS_MSG_BASE nsMsgIncomingServer : public nsIMsgIncomingServer, public nsSupportsWeakReference @@ -116,6 +116,6 @@ protected: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif // nsMsgIncomingServer_h__ diff --git a/mozilla/mailnews/base/util/nsMsgMailNewsUrl.h b/mozilla/mailnews/base/util/nsMsgMailNewsUrl.h index ab8b5074714..1d776d6a25b 100644 --- a/mozilla/mailnews/base/util/nsMsgMailNewsUrl.h +++ b/mozilla/mailnews/base/util/nsMsgMailNewsUrl.h @@ -63,7 +63,7 @@ ////////////////////////////////////////////////////////////////////////////////// #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class NS_MSG_BASE nsMsgMailNewsUrl : public nsIMsgMailNewsUrl { @@ -110,6 +110,6 @@ protected: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif /* nsMsgMailNewsUrl_h___ */ diff --git a/mozilla/mailnews/base/util/nsMsgProtocol.h b/mozilla/mailnews/base/util/nsMsgProtocol.h index 09510f8bc2c..45a80b63f5e 100644 --- a/mozilla/mailnews/base/util/nsMsgProtocol.h +++ b/mozilla/mailnews/base/util/nsMsgProtocol.h @@ -65,7 +65,7 @@ class nsMsgFilePostHelper; class nsIProxyInfo; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT // This is a helper class used to encapsulate code shared between all of the // mailnews protocol objects (imap, news, pop, smtp, etc.) In particular, @@ -254,6 +254,6 @@ protected: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif /* nsMsgProtocol_h__ */ diff --git a/mozilla/mailnews/base/util/nsMsgTxn.h b/mozilla/mailnews/base/util/nsMsgTxn.h index cd1ce48d876..0f8355cd979 100644 --- a/mozilla/mailnews/base/util/nsMsgTxn.h +++ b/mozilla/mailnews/base/util/nsMsgTxn.h @@ -52,7 +52,7 @@ */ #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class NS_MSG_BASE nsMsgTxn : public nsITransaction { @@ -83,6 +83,6 @@ protected: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif diff --git a/mozilla/xpcom/base/nscore.h b/mozilla/xpcom/base/nscore.h index 6addc519569..dbc355932ce 100644 --- a/mozilla/xpcom/base/nscore.h +++ b/mozilla/xpcom/base/nscore.h @@ -81,34 +81,40 @@ * wrap your class as follows: * * #undef IMETHOD_VISIBILITY - * #define IMETHOD_VISIBILITY default - + * #define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT + * * class Foo { * ... * }; * * #undef IMETHOD_VISIBILITY - * #define IMETHOD_VISIBILITY hidden + * #define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN * * Don't forget to change the visibility back to hidden before the end * of a header! + * + * Other examples: + * + * NS_HIDDEN_(int) someMethod(); + * SomeCtor() NS_HIDDEN; */ -#ifdef HAVE_VISIBILITY_ATTRIBUTE_notyet -#define NS_VISIBILITY_(vis) __attribute__ ((visibility (#vis))) -#define NS_HIDDEN_(type) type NS_VISIBILITY(hidden) +#ifdef HAVE_VISIBILITY_ATTRIBUTE +#define NS_VISIBILITY_HIDDEN __attribute__ ((visibility ("hidden"))) +#define NS_VISIBILITY_DEFAULT + +#define NS_HIDDEN_(type) type NS_VISIBILITY_HIDDEN #else -#define NS_VISIBILITY_(vis) +#define NS_VISIBILITY_HIDDEN +#define NS_VISIBILITY_DEFAULT + #define NS_HIDDEN_(type) type #endif -#define NS_HIDDEN NS_VISIBILITY(hidden) +#define NS_HIDDEN NS_VISIBILITY_HIDDEN #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden -/* Extra layer of macro expansion to allow IMETHOD_VISIBILITY to be - stringified. */ -#define NS_VISIBILITY(vis) NS_VISIBILITY_(vis) +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #ifdef NS_WIN32 @@ -140,7 +146,7 @@ #define NS_IMPORT_(type) type #define NS_EXPORT #define NS_EXPORT_(type) type -#define NS_IMETHOD_(type) virtual type NS_VISIBILITY(IMETHOD_VISIBILITY) +#define NS_IMETHOD_(type) virtual type IMETHOD_VISIBILITY #define NS_IMETHODIMP_(type) type #define NS_METHOD_(type) type #define NS_CALLBACK_(_type, _name) _type (* _name) diff --git a/mozilla/xpcom/ds/nsSupportsArray.h b/mozilla/xpcom/ds/nsSupportsArray.h index 652246d7641..69efcdbdf2a 100644 --- a/mozilla/xpcom/ds/nsSupportsArray.h +++ b/mozilla/xpcom/ds/nsSupportsArray.h @@ -45,7 +45,7 @@ static const PRUint32 kAutoArraySize = 8; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class NS_COM nsSupportsArray : public nsISupportsArray { public: @@ -167,6 +167,6 @@ private: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN #endif // nsSupportsArray_h__ diff --git a/mozilla/xpcom/glue/nsWeakReference.h b/mozilla/xpcom/glue/nsWeakReference.h index 2fcd2df7718..cc8a6316b79 100644 --- a/mozilla/xpcom/glue/nsWeakReference.h +++ b/mozilla/xpcom/glue/nsWeakReference.h @@ -30,7 +30,7 @@ class nsWeakReference; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference { @@ -65,7 +65,7 @@ class NS_COM nsSupportsWeakReference : public nsISupportsWeakReference }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN class NS_COM nsWeakReference : public nsIWeakReference { diff --git a/mozilla/xpcom/reflect/xptcall/public/xptcall.h b/mozilla/xpcom/reflect/xptcall/public/xptcall.h index 5983180fdc1..eb5f631834f 100644 --- a/mozilla/xpcom/reflect/xptcall/public/xptcall.h +++ b/mozilla/xpcom/reflect/xptcall/public/xptcall.h @@ -187,7 +187,7 @@ struct nsXPTCVariant : public nsXPTCMiniVariant /***************************************************************************/ #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY default +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT class nsXPTCStubBase : public nsISupports { @@ -215,7 +215,7 @@ public: }; #undef IMETHOD_VISIBILITY -#define IMETHOD_VISIBILITY hidden +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN PR_BEGIN_EXTERN_C