From 7455592a094a20357f473b3c563b7cfd51c652bc Mon Sep 17 00:00:00 2001 From: "mhammond%skippinet.com.au" Date: Tue, 5 Mar 2002 23:55:25 +0000 Subject: [PATCH] Use new module init/term functions for Linux. Not part of the build. git-svn-id: svn://10.0.0.236/trunk@115881 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/extensions/python/xpcom/src/dllmain.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mozilla/extensions/python/xpcom/src/dllmain.cpp b/mozilla/extensions/python/xpcom/src/dllmain.cpp index 44def06654e..19cd9f42a69 100644 --- a/mozilla/extensions/python/xpcom/src/dllmain.cpp +++ b/mozilla/extensions/python/xpcom/src/dllmain.cpp @@ -36,7 +36,6 @@ #endif static PRInt32 g_cLockCount = 0; -static PRBool bDidInitPython = PR_FALSE; static PyThreadState *ptsGlobal = nsnull; PyInterpreterState *PyXPCOM_InterpreterState; static PRLock *g_lockMain = nsnull; @@ -188,7 +187,11 @@ void PyXPCOM_DLLRelease(void) PR_AtomicDecrement(&g_cLockCount); } -extern "C" PRBool _init(void) +static void pyxpcom_construct() __attribute__((constructor)); +static void pyxpcom_destruct() __attribute__((destructor)); + + +void pyxpcom_construct(void) { PRStatus status; g_lockMain = PR_NewLock(); @@ -196,12 +199,12 @@ extern "C" PRBool _init(void) NS_WARN_IF_FALSE(status==0, "Could not allocate TLS storage"); if (NS_FAILED(status)) { PR_DestroyLock(g_lockMain); - return PR_FALSE; + return; // PR_FALSE; } - return PR_TRUE; + return; // PR_TRUE; } -extern "C" void _fini(void) +void pyxpcom_destruct(void) { PR_DestroyLock(g_lockMain); // I can't locate a way to kill this -