LAview.LaTeX-Struct/src/library_constructor.c

36 lines
899 B
C
Raw Normal View History

#if defined(_WIN32) || defined(_WIN64)
2014-04-09 17:43:14 +04:00
#include <windows.h>
#endif
#include "gettext-config.h"
#if defined(_WIN32) || defined(_WIN64)
2014-04-09 17:43:14 +04:00
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
#elif defined(linux) || defined(UNIX) || defined(__unix__)
void __attribute__ ((constructor)) load_library (void)
2014-04-09 17:43:14 +04:00
#endif
{
#if defined(_WIN32) || defined(_WIN64)
2014-04-09 17:43:14 +04:00
gchar dllPath[FILENAME_MAX],
*dllDir,
*localePath;
GetModuleFileName (hInstance, dllPath, FILENAME_MAX);
dllDir = g_path_get_dirname (dllPath);
localePath = g_build_filename (dllDir, "../share/locale", NULL);
g_free (dllDir);
bindtextdomain (GETTEXT_PACKAGE, localePath);
g_free (localePath);
#endif
#if (!GLIB_CHECK_VERSION (2, 36, 0))
g_type_init ();
#endif
2014-04-09 17:43:14 +04:00
#if defined(_WIN32) || defined(_WIN64)
(void) dwReason; // avoid
(void) lpReserved; // warngings
2014-04-09 17:43:14 +04:00
return TRUE;
#endif
}