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
|
|
|
|
|
2010-05-09 12:15:40 -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
|
|
|
{
|
2010-05-09 12:15:40 -03:00
|
|
|
switch (flag)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
if (_CRT_init())
|
|
|
|
return 0;
|
|
|
|
__ctordtorInit();
|
|
|
|
|
|
|
|
/* Ignore fatal signals */
|
|
|
|
signal(SIGSEGV, SIG_IGN);
|
|
|
|
signal(SIGFPE, SIG_IGN);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
__ctordtorTerm();
|
|
|
|
_CRT_term();
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
2002-02-17 01:23:30 -04:00
|
|
|
}
|