Changeset 112
- Timestamp:
- Aug 24, 2010, 1:52:33 AM (15 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk/hotspot/src/os/os2/vm/os_os2_init.cpp
r92 r112 2 2 * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2010 netlabs.org. OS/2 Parts. 4 6 * 5 7 * This code is free software; you can redistribute it and/or modify it … … 23 25 */ 24 26 25 // As the OS/2 platform currently reuses the Windows sources, here we only 26 // redirect the OS/2 DLL initialization/termination calls to DllMain() 27 28 #ifdef __WIN32OS2__ 27 // This code redirects the OS/2 DLL initialization/termination calls to 28 // the Windows DllMain() 29 29 30 30 #include <os2.h> // Odin32 OS/2 api wrappers … … 49 49 unsigned long SYSTEM _DLL_InitTerm(unsigned long hModule, unsigned long ulFlag) 50 50 { 51 size_t i;52 APIRET rc;51 size_t i; 52 APIRET rc; 53 53 54 // If ulFlag is zero then the DLL is being loaded so initialization should55 // be performed. If ulFlag is 1 then the DLL is being freed so termination56 // should be performed. A non-zero value must be returned to indicate success.54 // If ulFlag is zero then the DLL is being loaded so initialization should 55 // be performed. If ulFlag is 1 then the DLL is being freed so termination 56 // should be performed. A non-zero value must be returned to indicate success. 57 57 58 switch (ulFlag) {59 case 0 :58 switch (ulFlag) { 59 case 0 : 60 60 #ifdef __EMX__ 61 // initialize the C library62 if (_CRT_init())63 break;64 // initialize C++ statics65 __ctordtorInit();61 // initialize the C library 62 if (_CRT_init()) 63 break; 64 // initialize C++ statics 65 __ctordtorInit(); 66 66 #else 67 67 # error "Add code to initialize C/C++ library of this compiler!" 68 68 #endif 69 69 70 // check that the runtime Odin version matches the compile time version71 // (this will issue a message box and abort the process on mismatch)72 CheckVersionFromHMOD(PE2LX_VERSION, hModule);70 // check that the runtime Odin version matches the compile time version 71 // (this will issue a message box and abort the process on mismatch) 72 CheckVersionFromHMOD(PE2LX_VERSION, hModule); 73 73 74 // enable __try/__except support75 EnableSEH();74 // enable __try/__except support 75 EnableSEH(); 76 76 77 dllHandle = RegisterLxDll(hModule, DllMain, NULL);78 if (dllHandle == 0)79 break;77 dllHandle = RegisterLxDll(hModule, DllMain, NULL); 78 if (dllHandle == 0) 79 break; 80 80 81 return 1;81 return 1; 82 82 83 case 1 :84 if (dllHandle) {85 UnregisterLxDll(dllHandle);86 }83 case 1 : 84 if (dllHandle) { 85 UnregisterLxDll(dllHandle); 86 } 87 87 #ifdef __EMX__ 88 // destroy C++ statics89 __ctordtorTerm();90 _CRT_term();88 // destroy C++ statics 89 __ctordtorTerm(); 90 _CRT_term(); 91 91 #else 92 92 # error "Add code to initialize C/C++ library of this compiler!" 93 93 #endif 94 return 0; 95 96 default: 97 break; 98 } 99 100 // failure 94 101 return 0; 95 96 default:97 break;98 }99 100 // failure101 return 0;102 102 } 103 103 104 #endif // __WIN32OS2__
Note:
See TracChangeset
for help on using the changeset viewer.