diff --git a/dtool/src/prc/notifyCategoryProxy.h b/dtool/src/prc/notifyCategoryProxy.h index 4349b4a04b..9e3c239c5e 100644 --- a/dtool/src/prc/notifyCategoryProxy.h +++ b/dtool/src/prc/notifyCategoryProxy.h @@ -127,6 +127,16 @@ INLINE ostream &operator << (ostream &out, NotifyCategoryProxy &pro #ifdef CPPPARSER #define NotifyCategoryDecl(basename, expcl, exptp) +#elif defined(WIN32_VC) +// MSVC's rules for extern template classes differ slightly. +#define NotifyCategoryDecl(basename, expcl, exptp) \ + class expcl NotifyCategoryGetCategory_ ## basename { \ + public: \ + NotifyCategoryGetCategory_ ## basename(); \ + static NotifyCategory *get_category(); \ + }; \ + EXPORT_TEMPLATE_CLASS(expcl, exptp, NotifyCategoryProxy); \ + extern expcl NotifyCategoryProxy basename ## _cat; #else #define NotifyCategoryDecl(basename, expcl, exptp) \ class expcl NotifyCategoryGetCategory_ ## basename { \ @@ -134,7 +144,7 @@ INLINE ostream &operator << (ostream &out, NotifyCategoryProxy &pro NotifyCategoryGetCategory_ ## basename(); \ static NotifyCategory *get_category(); \ }; \ - exptp template class expcl NotifyCategoryProxy; \ + EXPORT_TEMPLATE_CLASS(expcl, extern, NotifyCategoryProxy); \ extern expcl NotifyCategoryProxy basename ## _cat; #endif @@ -161,6 +171,7 @@ INLINE ostream &operator << (ostream &out, NotifyCategoryProxy &pro #else #define NotifyCategoryDefName(basename, actual_name, parent_category) \ + template class NotifyCategoryProxy; \ NotifyCategoryProxy basename ## _cat; \ static NotifyCategoryGetCategory_ ## basename force_init_ ## basename ## _cat; \ NotifyCategoryGetCategory_ ## basename:: \ diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 5cc0313bd3..5a4d39a7fb 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -1155,7 +1155,8 @@ def CompileCxx(obj,src,opts): if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val for x in ipath: cmd += ' -I' + x - cmd += ' -fvisibility=hidden' + if not GetLinkAllStatic(): + cmd += ' -fvisibility=hidden' # Mac-specific flags. if GetTarget() == "darwin": @@ -3227,8 +3228,8 @@ if (not RTDIST and not RUNTIME): OPTS=['DIR:dtool/src/test_interrogate'] TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx') TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj') - TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll') + TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB) TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER']) #