Changeset 2298 for trunk/src/kernel32/misc.cpp
- Timestamp:
- Jan 2, 2000, 11:09:02 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/misc.cpp
r2061 r2298 1 /* $Id: misc.cpp,v 1.1 5 1999-12-12 14:32:38sandervl Exp $ */1 /* $Id: misc.cpp,v 1.16 2000-01-02 22:09:01 sandervl Exp $ */ 2 2 3 3 /* … … 29 29 #include "initterm.h" 30 30 #include "logging.h" 31 #include <wprocess.h> 31 32 32 33 /***************************************************************************** … … 273 274 if(fLogging && flog) 274 275 { 276 THDB *thdb = GetThreadTHDB(); 277 275 278 va_start(argptr, tekst); 279 if(thdb) thdb->logfile = (DWORD)flog; 276 280 vfprintf(flog, tekst, argptr); 281 if(thdb) thdb->logfile = 0; 277 282 va_end(argptr); 278 283 … … 280 285 fprintf(flog, "\n"); 281 286 } 282 287 fflush(flog); 283 288 SetFS(sel); 284 289 return 1; … … 293 298 if(fLogging && logfile) 294 299 { 300 THDB *thdb = GetThreadTHDB(); 301 295 302 va_start(argptr, tekst); 303 if(thdb) thdb->logfile = (DWORD)logfile; 296 304 vfprintf((FILE *)logfile, tekst, argptr); 305 if(thdb) thdb->logfile = 0; 297 306 va_end(argptr); 298 307 … … 303 312 SetFS(sel); 304 313 return 1; 314 } 315 //****************************************************************************** 316 //Check if the exception occurred inside a fprintf (logging THDB member set) 317 //If true, decrease the lock count for that file stream 318 //NOTE: HACK: DEPENDS ON COMPILER VERSION!!!! 319 //****************************************************************************** 320 void CheckLogException() 321 { 322 THDB *thdb = GetThreadTHDB(); 323 USHORT *lock; 324 325 if(!thdb) return; 326 327 if(thdb->logfile) { 328 //oops, exception in vfprintf; let's clear the lock count 329 #if (__IBMCPP__ == 300) || (__IBMC__ == 300) 330 lock = (USHORT *)(thdb->logfile+0x1C); 331 #else 332 #error Check the offset of the lock count word in the file stream structure for this compiler revision!!!!! 333 #endif 334 (*lock)--; 335 } 305 336 } 306 337 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.