From 60b73526d6797ee466c272dbfca962a230bc5908 Mon Sep 17 00:00:00 2001 From: Ron Lee Date: Thu, 20 Dec 2001 13:11:11 +0000 Subject: [PATCH] ugh. Nesting the (per class) plugin sentries can require them to have user export syntax under win32 (unlike the old method which had it's own uglyness though). Consider this a quickfix for win32, will look at better solutions after some sleep. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13132 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dynload.h | 2 +- include/wx/object.h | 50 +++++++++++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/include/wx/dynload.h b/include/wx/dynload.h index 2678f23dbe..d41c85802a 100644 --- a/include/wx/dynload.h +++ b/include/wx/dynload.h @@ -128,7 +128,7 @@ private: // wxDynamicLibrary // --------------------------------------------------------------------------- -class wxDLManifestEntry +class WXDLLEXPORT wxDLManifestEntry { public: diff --git a/include/wx/object.h b/include/wx/object.h index 69ad1b9f88..f165dd1693 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -195,22 +195,15 @@ WXDLLEXPORT wxObject *wxCreateDynamicObject(const wxChar *name); #if wxUSE_NESTED_CLASSES -#if 0 -#define _DECLARE_DL_SENTINEL(name) \ - wxPluginSentinel m_pluginsentinel; - -#else - -#define _DECLARE_DL_SENTINEL(name) \ -class name##PluginSentinel { \ -private: \ - static const wxString sm_className; \ -public: \ - name##PluginSentinel(); \ - ~##name##PluginSentinel(); \ -}; \ +#define _DECLARE_DL_SENTINEL(name, exportdecl) \ +class exportdecl name##PluginSentinel { \ +private: \ + static const wxString sm_className; \ +public: \ + name##PluginSentinel(); \ + ~##name##PluginSentinel(); \ +}; \ name##PluginSentinel m_pluginsentinel; -#endif #define _IMPLEMENT_DL_SENTINEL(name) \ const wxString name::name##PluginSentinel::sm_className(#name); \ @@ -230,21 +223,33 @@ name##PluginSentinel m_pluginsentinel; #endif // wxUSE_NESTED_CLASSES #define DECLARE_PLUGGABLE_CLASS(name) \ - DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name) - + DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name, WXDLLEXPORT) #define DECLARE_ABSTRACT_PLUGGABLE_CLASS(name) \ - DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name) + DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name, WXDLLEXPORT) + +#define DECLARE_USER_EXPORTED_PLUGGABLE_CLASS(name, usergoo) \ + DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name, usergoo) +#define DECLARE_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, usergoo) \ + DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name, usergoo) #define IMPLEMENT_PLUGGABLE_CLASS(name, basename) \ IMPLEMENT_DYNAMIC_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name) #define IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2) \ IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name) - #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) \ IMPLEMENT_ABSTRACT_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name) #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \ IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name) +#define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS(name, basename) \ + IMPLEMENT_PLUGGABLE_CLASS(name, basename) +#define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS2(name, basename1, basename2) \ + IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2) +#define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, basename) \ + IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) +#define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \ + IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) + #define CLASSINFO(name) (&name::sm_class##name) @@ -269,6 +274,13 @@ name##PluginSentinel m_pluginsentinel; #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) +#define DECLARE_USER_EXPORTED_PLUGGABLE_CLASS(name, usergoo) +#define DECLARE_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, usergoo) +#define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS(name, basename) +#define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS2(name, basename1, basename2) +#define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, basename) +#define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) + #endif // wxUSE_DYNAMIC_CLASSES