2002-02-17 01:23:30 -04:00
|
|
|
/*
|
2003-04-22 00:21:42 -03:00
|
|
|
* This is the entry point for the Python 2.3 core DLL.
|
|
|
|
*/
|
2002-02-17 01:23:30 -04:00
|
|
|
|
|
|
|
#define NULL 0
|
|
|
|
|
2003-04-22 00:21:42 -03:00
|
|
|
#define REF(s) extern void s(); void *____ref_##s = &s;
|
2002-02-17 01:23:30 -04:00
|
|
|
|
2003-04-22 00:21:42 -03:00
|
|
|
/* Make references to imported symbols to pull them from static library */
|
|
|
|
REF(Py_Main);
|
2002-02-17 01:23:30 -04:00
|
|
|
|
|
|
|
#include <signal.h>
|
|
|
|
|
2003-04-22 00:21:42 -03:00
|
|
|
extern int _CRT_init(void);
|
|
|
|
extern void _CRT_term(void);
|
|
|
|
extern void __ctordtorInit(void);
|
|
|
|
extern void __ctordtorTerm(void);
|
2002-02-17 01:23:30 -04:00
|
|
|
|
2003-04-22 00:21:42 -03:00
|
|
|
unsigned long _DLL_InitTerm(unsigned long mod_handle, unsigned long flag)
|
2002-02-17 01:23:30 -04:00
|
|
|
{
|
2002-12-31 07:23:50 -04:00
|
|
|
switch (flag)
|
|
|
|
{
|
|
|
|
case 0:
|
2003-04-22 00:21:42 -03:00
|
|
|
if (_CRT_init())
|
2002-12-31 07:23:50 -04:00
|
|
|
return 0;
|
2003-04-22 00:21:42 -03:00
|
|
|
__ctordtorInit();
|
2002-12-31 07:23:50 -04:00
|
|
|
|
|
|
|
/* Ignore fatal signals */
|
2003-04-22 00:21:42 -03:00
|
|
|
signal(SIGSEGV, SIG_IGN);
|
|
|
|
signal(SIGFPE, SIG_IGN);
|
2002-12-31 07:23:50 -04:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
case 1:
|
2003-04-22 00:21:42 -03:00
|
|
|
__ctordtorTerm();
|
|
|
|
_CRT_term();
|
2002-12-31 07:23:50 -04:00
|
|
|
return 1;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
2002-02-17 01:23:30 -04:00
|
|
|
}
|