Yet another attempt at portable library init and finalize. Thanks to

Christof Meerwald.

Not part of the build; global "a=" for this part of the tree.


git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_0_BRANCH@120249 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mhammond%skippinet.com.au
2002-04-29 23:22:16 +00:00
parent 9187ea31c1
commit 7093aeefa2

View File

@@ -187,10 +187,6 @@ void PyXPCOM_DLLRelease(void)
PR_AtomicDecrement(&g_cLockCount);
}
static void pyxpcom_construct() __attribute__((constructor));
static void pyxpcom_destruct() __attribute__((destructor));
void pyxpcom_construct(void)
{
PRStatus status;
@@ -212,6 +208,16 @@ void pyxpcom_destruct(void)
// TlsFree(tlsIndex);
}
// Yet another attempt at cross-platform library initialization and finalization.
struct DllInitializer {
DllInitializer() {
pyxpcom_construct();
}
~DllInitializer() {
pyxpcom_destruct();
}
} dll_initializer;
#ifdef XP_WIN
extern "C" __declspec(dllexport)