Updated with fix for #3126.
[python.git] / PC / os2emx / dllentry.c
blobdbf9c98d003019a6721bde1a617037c337fd3cf7
1 /*
2 * This is the entry point for the Python 2.3 core DLL.
3 */
5 #define NULL 0
7 #define REF(s) extern void s(); void *____ref_##s = &s;
9 /* Make references to imported symbols to pull them from static library */
10 REF(Py_Main);
12 #include <signal.h>
14 extern int _CRT_init(void);
15 extern void _CRT_term(void);
16 extern void __ctordtorInit(void);
17 extern void __ctordtorTerm(void);
19 unsigned long _DLL_InitTerm(unsigned long mod_handle, unsigned long flag)
21 switch (flag)
23 case 0:
24 if (_CRT_init())
25 return 0;
26 __ctordtorInit();
28 /* Ignore fatal signals */
29 signal(SIGSEGV, SIG_IGN);
30 signal(SIGFPE, SIG_IGN);
32 return 1;
34 case 1:
35 __ctordtorTerm();
36 _CRT_term();
37 return 1;
39 default:
40 return 0;