/PC/os2emx/dllentry.c

http://unladen-swallow.googlecode.com/ · C · 42 lines · 27 code · 10 blank · 5 comment · 2 complexity · 7bc8833437056cd680854f7d3564dfca MD5 · raw file

  1. /*
  2. * This is the entry point for the Python 2.3 core DLL.
  3. */
  4. #define NULL 0
  5. #define REF(s) extern void s(); void *____ref_##s = &s;
  6. /* Make references to imported symbols to pull them from static library */
  7. REF(Py_Main);
  8. #include <signal.h>
  9. extern int _CRT_init(void);
  10. extern void _CRT_term(void);
  11. extern void __ctordtorInit(void);
  12. extern void __ctordtorTerm(void);
  13. unsigned long _DLL_InitTerm(unsigned long mod_handle, unsigned long flag)
  14. {
  15. switch (flag)
  16. {
  17. case 0:
  18. if (_CRT_init())
  19. return 0;
  20. __ctordtorInit();
  21. /* Ignore fatal signals */
  22. signal(SIGSEGV, SIG_IGN);
  23. signal(SIGFPE, SIG_IGN);
  24. return 1;
  25. case 1:
  26. __ctordtorTerm();
  27. _CRT_term();
  28. return 1;
  29. default:
  30. return 0;
  31. }
  32. }