static int ref_count = 0;
-#ifdef _WIN32
-static HMODULE libbabl_dll = NULL;
-
-/* Minimal DllMain that just stores the handle to this DLL */
-
-/* Avoid silly "no previous prototype" gcc warning */
-BOOL WINAPI
-DllMain (HINSTANCE hinstDLL,
- DWORD fdwReason,
- LPVOID lpvReserved);
-
-BOOL WINAPI
-DllMain (HINSTANCE hinstDLL,
- DWORD fdwReason,
- LPVOID lpvReserved)
-{
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
- libbabl_dll = hinstDLL;
- break;
- }
-
- return TRUE;
-}
-
-#else
+#ifndef _WIN32
#define BABL_PATH LIBDIR BABL_DIR_SEPARATOR BABL_LIBRARY
-#endif /* _WIN32 */
+#endif
/*
* Returns a list of directories if the environment variable $BABL_PATH
wchar_t w_filename[MAX_PATH];
DWORD nSize = sizeof (w_filename) / sizeof ((w_filename)[0]);
- if (GetModuleFileNameW (libbabl_dll, w_filename, nSize) == 0)
+ if (GetModuleFileNameW (get_libbabl_module (), w_filename, nSize) == 0)
babl_fatal ("GetModuleFilenameW failed");
filename_size = WideCharToMultiByte (CP_UTF8, 0, w_filename, -1, NULL, 0,