- Timestamp:
- Dec 17, 2000, 12:33:37 AM (25 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dllentry/dllentry.cpp
r3993 r4818 1 /* $Id: dllentry.cpp,v 1. 2 2000-08-11 10:56:14 sandervlExp $ */1 /* $Id: dllentry.cpp,v 1.3 2000-12-16 23:31:07 bird Exp $ */ 2 2 3 3 /* … … 37 37 #include <misc.h> /*PLF Wed 98-03-18 23:18:15*/ 38 38 39 39 40 extern "C" { 41 #ifdef __IBMCPP__ 40 42 void CDECL _ctordtorInit( void ); 41 43 void CDECL _ctordtorTerm( void ); 42 44 #endif 43 45 //Win32 resource table (produced by wrc) 44 46 extern DWORD _Resource_PEResTab; … … 53 55 switch (fdwReason) 54 56 { 55 case DLL_PROCESS_ATTACH:56 57 case DLL_PROCESS_ATTACH: 58 return TRUE; 57 59 58 case DLL_THREAD_ATTACH:59 case DLL_THREAD_DETACH:60 60 case DLL_THREAD_ATTACH: 61 case DLL_THREAD_DETACH: 62 return TRUE; 61 63 62 case DLL_PROCESS_DETACH: 63 _ctordtorTerm(); 64 return TRUE; 64 case DLL_PROCESS_DETACH: 65 #ifdef __IBMCPP__ 66 _ctordtorTerm(); 67 #endif 68 return TRUE; 65 69 } 66 70 return FALSE; 67 71 } 72 73 74 #ifdef __IBMCPP__ 75 68 76 /****************************************************************************/ 69 77 /* _DLL_InitTerm is the function that gets called by the operating system */ … … 74 82 /* calling this function. */ 75 83 /****************************************************************************/ 76 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long 77 ulFlag) 84 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long ulFlag) 78 85 { 79 size_t i;80 APIRET rc;81 82 86 /*-------------------------------------------------------------------------*/ 83 87 /* If ulFlag is zero then the DLL is being loaded so initialization should */ … … 86 90 /*-------------------------------------------------------------------------*/ 87 91 88 switch (ulFlag) { 92 switch (ulFlag) 93 { 89 94 case 0: 90 95 _ctordtorInit(); 96 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 97 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab); 98 if (dllHandle == 0) 99 return 0UL; 100 break; 91 101 92 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 102 case 1: 103 if (dllHandle) 104 UnregisterLxDll(dllHandle); 105 break; 93 106 94 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab);95 if(dllHandle == 0)96 return 0UL;97 98 break;99 case 1:100 if(dllHandle) {101 UnregisterLxDll(dllHandle);102 }103 break;104 107 default: 105 108 return 0UL; … … 111 114 return 1UL; 112 115 } 113 //****************************************************************************** 114 //****************************************************************************** 116 #elif defined(__WATCOM_CPLUSPLUS__) 117 /* 118 * Watcom dll init and term routines. 119 */ 120 121 int __dll_initialize(unsigned long hModule, unsigned long ulFlag) 122 { 123 CheckVersionFromHMOD(PE2LX_VERSION, hModule); 124 dllHandle = RegisterLxDll(hModule, LibMain, (PVOID)&_Resource_PEResTab); 125 if (dllHandle == 0) 126 return 0; 127 return 1; 128 } 129 130 int __dll_terminate(unsigned long hModule, unsigned long ulFlag) 131 { 132 if (dllHandle) 133 UnregisterLxDll(dllHandle); 134 return 1; 135 } 136 137 #else 138 #error message("compiler is not supported!\n"); 139 #endif -
trunk/src/dllentry/makefile
r4717 r4818 1 # $Id: makefile,v 1. 7 2000-12-02 23:39:06bird Exp $1 # $Id: makefile,v 1.8 2000-12-16 23:31:08 bird Exp $ 2 2 3 3 # … … 30 30 # 31 31 # Target name - name of the obj without extention and path. 32 # NB. Watcom will need it's own target...33 32 # 34 !ifndef WAT35 33 TARGET = dllentry 36 !else37 TARGET = dllentry_watcom38 !endif39 34 40 35 … … 42 37 # All rule - build objs and copies obj to lib. 43 38 # 44 all: $(OBJDIR) $(ODIN32_LIB)\$(TARGET).obj 39 all: $(OBJDIR) \ 40 $(ODIN32_LIB) \ 41 $(ODIN32_LIB)\$(TARGET).obj 45 42 46 43 … … 56 53 57 54 55 # Create lib directory. 56 $(ODIN32_LIB): 57 $(CREATEPATH) $(ODIN32_LIB) 58 59 58 60 # 59 61 # Includes the common rules. -
trunk/src/odincrt/initterm.cpp
r2649 r4818 1 /* $Id: initterm.cpp,v 1. 3 2000-02-05 02:05:37 sandervlExp $ */1 /* $Id: initterm.cpp,v 1.4 2000-12-16 23:33:37 bird Exp $ */ 2 2 3 3 /* … … 35 35 #include <exitlist.h> 36 36 37 #ifdef __IBMCPP__ 37 38 extern "C" { 38 39 /*-------------------------------------------------------------------*/ … … 71 72 ulFlag) 72 73 { 73 size_t i;74 74 APIRET rc; 75 75 … … 134 134 return ; 135 135 } 136 137 #elif defined(__WATCOM_CPLUSPLUS__) 138 139 /* 140 * Watcom dll init and term routines. 141 */ 142 143 int __dll_initialize(unsigned long hModule, unsigned long ulFlag) 144 { 145 APIRET rc; 146 #if 1 /* 147 * Experimental console hack. Sets apptype to PM anyhow. 148 * First Dll to be initiated should now allways be OdinCrt! 149 * So include odincrt first! 150 */ 151 PPIB pPIB; 152 PTIB pTIB; 153 rc = DosGetInfoBlocks(&pTIB, &pPIB); 154 if (rc != NO_ERROR) 155 return 0UL; 156 pPIB->pib_ultype = 3; 157 #endif 158 return 1; 159 } 160 161 int __dll_terminate(unsigned long hModule, unsigned long ulFlag) 162 { 163 return 1; 164 } 165 166 #else 167 #error message("compiler is not supported"); 168 #endif 169 -
trunk/src/odincrt/makefile
r4717 r4818 1 # $Id: makefile,v 1.2 0 2000-12-02 23:40:36bird Exp $1 # $Id: makefile,v 1.21 2000-12-16 23:33:37 bird Exp $ 2 2 3 3 # … … 39 39 DEFFILE = odin36$(DBG).def 40 40 !endif 41 !ifdef WAT 42 DEFFILE = odinwat$(DBG).def 43 !endif 41 44 !ifndef DEFFILE 42 45 !error "not supported on this compiler yet." … … 50 53 $(OBJDIR)\odincrt.obj \ 51 54 $(OBJDIR)\initterm.obj \ 55 !ifndef WAT 52 56 $(OBJDIR)\malloc.obj \ 53 57 $(OBJDIR)\string.obj \ 54 58 $(OBJDIR)\file.obj 59 !else 60 $(%WATCOM)\lib386\os2\$(RTLLIB_O) 61 !endif 55 62 56 63 … … 58 65 # Libraries. One space before the '\'. 59 66 # 60 LIBS = 67 LIBS = \ 68 !ifdef WAT 69 $(RTLLIB_O) 70 !endif 61 71 62 72
Note:
See TracChangeset
for help on using the changeset viewer.