aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2007-11-16 00:48:42 -0800
committerChris Robinson <[email protected]>2007-11-16 00:48:42 -0800
commit092b88364bf041dd66ef5ef9ed57f16d7a7b28c6 (patch)
treeb36ae4557640c73294fd43d0e9bb2d58c44a1e26
parente0d31020096c2754c2b6848de28541a9822b2220 (diff)
Don't use platform-specific methods for initialization
-rw-r--r--Alc/ALc.c5
-rw-r--r--OpenAL32/OpenAL32.c14
2 files changed, 5 insertions, 14 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index a6ec7818..73e8bee5 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -204,6 +204,11 @@ static void InitAL(void)
if(!done)
{
int i;
+
+ InitializeCriticalSection(&g_mutex);
+ ALTHUNK_INIT();
+ ReadALConfig();
+
for(i = 0;BackendList[i].Init;i++)
BackendList[i].Init(&BackendList[i].Funcs);
done = 1;
diff --git a/OpenAL32/OpenAL32.c b/OpenAL32/OpenAL32.c
index 20ca14f9..dab7ec31 100644
--- a/OpenAL32/OpenAL32.c
+++ b/OpenAL32/OpenAL32.c
@@ -34,9 +34,6 @@ BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls(hModule);
- InitializeCriticalSection(&g_mutex);
- ALTHUNK_INIT();
- ReadALConfig();
break;
case DLL_PROCESS_DETACH:
@@ -49,17 +46,6 @@ BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
return TRUE;
}
#else
-static void my_init() __attribute__((constructor));
-static void my_init()
-{
- static ALenum once = AL_FALSE;
- if(once) return;
- once = AL_TRUE;
-
- InitializeCriticalSection(&g_mutex);
- ALTHUNK_INIT();
- ReadALConfig();
-}
static void my_deinit() __attribute__((destructor));
static void my_deinit()
{