#include "HGDef.h" #include "HGInfoImpl.hpp" #include "HGInc.h" extern HGInfoImpl* g_infoImpl; #if defined(HG_CMP_MSC) BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: { g_infoImpl = new HGInfoImpl; } break; case DLL_THREAD_ATTACH: break; case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: { delete g_infoImpl; g_infoImpl = NULL; } break; } return TRUE; } #else void __attribute__((constructor)) global_load(void); void __attribute__((destructor)) global_unload(void); void global_load(void) { g_infoImpl = new HGInfoImpl; } void global_unload(void) { delete g_infoImpl; g_infoImpl = NULL; } #endif