Changeset 510 for trunk/src/ddraw/initterm.cpp
- Timestamp:
- Aug 16, 1999, 6:28:05 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ddraw/initterm.cpp
r354 r510 1 /* $Id: initterm.cpp,v 1.6 1999-08-16 16:28:02 sandervl Exp $ */ 1 2 2 3 /* 3 4 * This file was created for Sander van Leeuwen 5 6 * by Project Smarts on 8 May 1997. 7 4 * DLL entry point 5 * 6 * Copyright 1998 Sander van Leeuwen 7 * Copyright 1998 Peter Fitzsimmons 8 * 9 * 10 * Project Odin Software License can be found in LICENSE.TXT 11 * 8 12 */ 9 13 … … 23 27 #define INCL_DOSMODULEMGR 24 28 #define INCL_DOSPROCESS 25 #include <os2wrap.h> 29 #include <os2wrap.h> //Odin32 OS/2 api wrappers 26 30 #include <stdlib.h> 27 31 #include <stdio.h> 28 32 #include <string.h> 29 33 #include <odin.h> 30 #include <misc.h> /*PLF Wed 98-03-18 23:18:29*/ 31 32 extern "C" { 33 /*-------------------------------------------------------------------*/ 34 /* _CRT_init is the C run-time environment initialization function. */ 35 /* It will return 0 to indicate success and -1 to indicate failure. */ 36 /*-------------------------------------------------------------------*/ 37 int CDECL CRT_init(void); 38 /*-------------------------------------------------------------------*/ 39 /* _CRT_term is the C run-time environment termination function. */ 40 /* It only needs to be called when the C run-time functions are */ 41 /* statically linked. */ 42 /*-------------------------------------------------------------------*/ 43 void CDECL CRT_term(void); 44 void CDECL _ctordtorInit( void ); 45 void CDECL _ctordtorTerm( void ); 46 } 47 /*-------------------------------------------------------------------*/ 48 /* A clean up routine registered with DosExitList must be used if */ 49 /* runtime calls are required and the runtime is dynamically linked. */ 50 /* This will guarantee that this clean up routine is run before the */ 51 /* library DLL is terminated. */ 52 /*-------------------------------------------------------------------*/ 53 static void APIENTRY cleanup(ULONG reason); 54 55 34 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 56 35 57 36 /****************************************************************************/ … … 63 42 /* calling this function. */ 64 43 /****************************************************************************/ 65 unsigned long _System_DLL_InitTerm(unsigned long hModule, unsigned long66 44 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long 45 ulFlag) 67 46 { 68 47 size_t i; … … 77 56 switch (ulFlag) { 78 57 case 0 : 79 80 /*******************************************************************/ 81 /* The C run-time environment initialization function must be */ 82 /* called before any calls to C run-time functions that are not */ 83 /* inlined. */ 84 /*******************************************************************/ 85 86 if (CRT_init() == -1) 87 return 0UL; 88 _ctordtorInit(); 89 90 //SvL: Temporarily disabled 91 #if 0 92 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 93 #endif 94 95 /*******************************************************************/ 96 /* A DosExitList routine must be used to clean up if runtime calls */ 97 /* are required and the runtime is dynamically linked. */ 98 /*******************************************************************/ 99 100 rc = DosExitList(0x0000FF00|EXLST_ADD, cleanup); 101 if(rc) 102 return 0UL; 103 58 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 104 59 break; 105 60 case 1 : … … 114 69 return 1UL; 115 70 } 116 117 118 static void APIENTRY cleanup(ULONG ulReason)119 {120 _ctordtorTerm();121 CRT_term();122 DosExitList(EXLST_EXIT, cleanup);123 return ;124 }
Note:
See TracChangeset
for help on using the changeset viewer.