Changeset 1111
- Timestamp:
- Feb 28, 2013, 11:47:15 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/corelib/plugin/qlibrary_os2.cpp
r877 r1111 48 48 #include "qfileinfo.h" 49 49 #include "qdir.h" 50 51 #include <float.h> 50 52 51 53 #ifndef QT_NO_LIBRARY … … 100 102 QByteArray attempt = QFile::encodeName(QDir::toNativeSeparators(fileName)); 101 103 104 // It is known that the OS/2 DLL loader (or the init routine of some DLLs) 105 // sometimes resets the FPU CW to a value that causes operations like 106 // division by zero to throw SIGFPE instead of being handled by the FPU. 107 // This is unexpected in many apps since they rely on the default C runtime 108 // setting which is to handle them. The solution is to force the required 109 // CW value and then restore it after loading the DLL. 110 111 _clear87(); 112 unsigned int oldbits = _control87(0, 0); 113 _control87(MCW_EM, MCW_EM); 114 102 115 APIRET rc; 103 116 char errModule[CCHMAXPATH] = { '\0' }; … … 108 121 rc = DosLoadModule(errModule, sizeof(errModule), attempt, &pHnd); 109 122 } 123 124 _clear87(); 125 _control87(oldbits, 0xFFFFF); 110 126 111 127 if (rc != NO_ERROR) {
Note:
See TracChangeset
for help on using the changeset viewer.