More installation info. Bump alpha version.
[python/dscho.git] / PC / os2emx / dllentry.c
blobea8d366eb60adb91eedc2473ac2625b5d64d8b7f
1 /*
2 This is the entry point for Python DLL(s).
3 It also provides an getenv() function that works from within DLLs.
4 */
6 #define NULL 0
8 /* Make references to imported symbols to pull them from static library */
9 #define REF(s) extern void s (); void *____ref_##s = &s;
11 REF (Py_Main);
13 #include <signal.h>
15 extern int _CRT_init (void);
16 extern void _CRT_term (void);
17 extern void __ctordtorInit (void);
18 extern void __ctordtorTerm (void);
20 unsigned long _DLL_InitTerm (unsigned long mod_handle, unsigned long flag)
22 switch (flag)
24 case 0:
25 if (_CRT_init ())
26 return 0;
27 __ctordtorInit ();
29 /* Ignore fatal signals */
30 signal (SIGSEGV, SIG_IGN);
31 signal (SIGFPE, SIG_IGN);
33 return 1;
35 case 1:
36 __ctordtorTerm ();
37 _CRT_term ();
38 return 1;
40 default:
41 return 0;