Don't use platform-specific methods for initialization
This commit is contained in:
parent
e0d3102009
commit
092b88364b
@ -204,6 +204,11 @@ static void InitAL(void)
|
|||||||
if(!done)
|
if(!done)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
InitializeCriticalSection(&g_mutex);
|
||||||
|
ALTHUNK_INIT();
|
||||||
|
ReadALConfig();
|
||||||
|
|
||||||
for(i = 0;BackendList[i].Init;i++)
|
for(i = 0;BackendList[i].Init;i++)
|
||||||
BackendList[i].Init(&BackendList[i].Funcs);
|
BackendList[i].Init(&BackendList[i].Funcs);
|
||||||
done = 1;
|
done = 1;
|
||||||
|
@ -34,9 +34,6 @@ BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
|
|||||||
{
|
{
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
DisableThreadLibraryCalls(hModule);
|
DisableThreadLibraryCalls(hModule);
|
||||||
InitializeCriticalSection(&g_mutex);
|
|
||||||
ALTHUNK_INIT();
|
|
||||||
ReadALConfig();
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
@ -49,17 +46,6 @@ BOOL APIENTRY DllMain(HANDLE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
#else
|
#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() __attribute__((destructor));
|
||||||
static void my_deinit()
|
static void my_deinit()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user