00001
00002
00003 #define MAJOR 2
00004 #define MINOR 0
00005 #define DLMAIN
00006
00007 #include <stdlib.h>
00008 #include "gridlabd.h"
00009
00010 EXPORT int do_kill(void*);
00011 EXPORT int major=MAJOR, minor=MINOR;
00012
00013 #ifdef WIN32
00014 #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
00015 #include <windows.h>
00016 BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID)
00017 {
00018 switch (ul_reason_for_call)
00019 {
00020 case DLL_PROCESS_ATTACH:
00021 case DLL_THREAD_ATTACH:
00022 break;
00023 case DLL_THREAD_DETACH:
00024 case DLL_PROCESS_DETACH:
00025 do_kill(hModule);
00026 break;
00027 }
00028 return TRUE;
00029 }
00030 #else // !WIN32
00031 CDECL int dllinit() __attribute__((constructor));
00032 CDECL int dllkill() __attribute__((destructor));
00033 CDECL int dllinit() { return 0;}
00034 CDECL int dllkill() { do_kill(NULL);}
00035 #endif // !WIN32
00036
00037