Changeset 439 for trunk/src/emx
- Timestamp:
- Jul 25, 2003, 3:37:21 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/startup/dllinit.c
-
Property cvs2svn:cvs-rev
changed from
1.5
to1.6
r438 r439 1 /* This is the startup code for gcc.dll (and can be used as well for any other 2 DLL which uses exceptions). It should call __ehInit() as any other dynamic 3 library which uses exceptions, otherwise the C++ programs linked to it will 4 fail to catch exceptions. 5 6 -= This is duplicated in libgcc and this copy must be removed when =- 7 -= we've done a new release! =- 8 9 */ 10 1 /* */ 2 #include <emx/startup.h> 11 3 extern int _CRT_init (void); 12 4 extern void __ctordtorInit (void); 13 5 extern void __ctordtorTerm (void); 14 extern void __ehInit (void); 15 extern void __ehTerm (void); 6 extern void __ehInitDLL (void); 7 #pragma weak __ehInitDLL 8 extern void __ehTermDLL (void); 9 #pragma weak __ehTermDLL 16 10 17 unsigned long _System _DLL_InitTerm (unsigned long mod_handle, unsigned long flag) 11 /** 12 * This is the typical DLL startup code. __ehInitDLL and __ehTermDLL is called 13 * are for exception handler stuff in gcc, the two functions will be linked if 14 * there is exception handler info in the module. (Btw. if these calls wasn't 15 * made we would fail to catch exceptions in C++ code.) 16 * @returns 1 on success. 17 * @returns 0 on failure. 18 * @param hmod Handle of this DLL. 19 * @param flag 0 init. 20 * 1 term. 21 * @remark This function is called from dll0.asm. 22 */ 23 unsigned _System _DLL_InitTerm (unsigned hmod, unsigned flag) 18 24 { 19 25 switch (flag) … … 21 27 case 0: 22 28 if (_CRT_init () != 0) 23 return 0; 29 break; 30 if (__ehInitDLL) 31 __ehInitDLL (); 24 32 __ctordtorInit (); 25 __ehInit ();26 33 return 1; 27 34 case 1: 28 __ehTerm ();29 35 __ctordtorTerm (); 36 if (__ehTermDLL) 37 __ehTermDLL (); 30 38 return 1; 31 default:32 return 0;33 39 } 40 return 0; 34 41 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.