[4075] | 1 | /* $Id: misc.h,v 1.17 2000-08-23 18:05:54 sandervl Exp $ */
|
---|
[4] | 2 |
|
---|
[17] | 3 | /*
|
---|
| 4 | * Miscellaneous definitions
|
---|
| 5 | * Debug prototypes and macros
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 |
|
---|
[4] | 9 | #ifndef __MISC_H__
|
---|
| 10 | #define __MISC_H__
|
---|
| 11 |
|
---|
[2341] | 12 | #if !defined(_OS2WIN_H) && !defined(__INCLUDE_WINUSER_H) && !defined(__WINE_WINBASE_H) && !defined(__WINE_WINDEF_H)
|
---|
[780] | 13 | #include <win32type.h>
|
---|
| 14 | #endif
|
---|
| 15 |
|
---|
[4] | 16 | #ifdef __cplusplus
|
---|
| 17 | extern "C" {
|
---|
| 18 | #endif
|
---|
| 19 |
|
---|
[25] | 20 | /* enable support for the _interrupt() statement */
|
---|
| 21 | #if (defined(__IBMCPP__) || defined(__IBMC__))
|
---|
| 22 | # include <builtin.h>
|
---|
[4075] | 23 | #ifdef DEBUG
|
---|
| 24 | #define DebugInt3() _interrupt(3)
|
---|
| 25 | #else
|
---|
| 26 | #define DebugInt3()
|
---|
[25] | 27 | #endif
|
---|
| 28 |
|
---|
[4075] | 29 | #else
|
---|
[4] | 30 | #ifdef DEBUG
|
---|
[4075] | 31 | #define DebugInt3() _asm int 3;
|
---|
[4] | 32 | #else
|
---|
[13] | 33 | #define DebugInt3()
|
---|
[4] | 34 | #endif
|
---|
| 35 |
|
---|
[4075] | 36 | #endif
|
---|
[4] | 37 |
|
---|
[4075] | 38 |
|
---|
[4] | 39 | #ifdef DEBUG
|
---|
[2061] | 40 | #ifdef PRIVATE_LOGGING
|
---|
| 41 | //To use private dll logging, define PRIVATE_LOGGING and
|
---|
| 42 | //add Open/ClosePrivateLogFiles (see below) functions to the dll
|
---|
| 43 | //to open close the private logfile. The logfile handle should
|
---|
| 44 | //be stored in the _privateLogFile variable
|
---|
| 45 | //dprintf can be called like this:
|
---|
| 46 | //dprintf((LOG, "PE file : %s", szFileName));
|
---|
| 47 | #define LOG (void*)_privateLogFile
|
---|
| 48 | #define dprintf(a) WritePrivateLog a
|
---|
| 49 | #define dprintfGlobal(a) WriteLog a
|
---|
| 50 | #else
|
---|
[13] | 51 | #define dprintf(a) WriteLog a
|
---|
[2061] | 52 | #endif
|
---|
[13] | 53 | #define eprintf(a) WriteLog a ; WriteLogError a
|
---|
| 54 | #define dassert(a, b) if(!(a)) WriteLogError b
|
---|
| 55 | #define dbgCheckObj(a) a->checkObject()
|
---|
[2431] | 56 | #define DisableLogging DecreaseLogCount
|
---|
| 57 | #define EnableLogging IncreaseLogCount
|
---|
[1669] | 58 |
|
---|
| 59 | #ifdef DEBUG_ENABLELOG_LEVEL2
|
---|
[2061] | 60 | #ifdef PRIVATE_LOGGING
|
---|
| 61 | #define dprintf2(a) WritePrivateLog a
|
---|
[4] | 62 | #else
|
---|
[2061] | 63 | #define dprintf2(a) WriteLog a
|
---|
| 64 | #endif
|
---|
| 65 | #else
|
---|
[1669] | 66 | #define dprintf2(a)
|
---|
| 67 | #endif
|
---|
| 68 |
|
---|
| 69 | #else
|
---|
[2061] | 70 | #define dprintfGlobal(a)
|
---|
[13] | 71 | #define dprintf(a)
|
---|
[1953] | 72 | #define dprintf2(a)
|
---|
[13] | 73 | #define eprintf(a)
|
---|
| 74 | #define dassert(a, b)
|
---|
| 75 | #define dbgCheckObj(a)
|
---|
[2431] | 76 | #define DisableLogging
|
---|
| 77 | #define EnableLogging
|
---|
[4] | 78 | #endif
|
---|
| 79 |
|
---|
[17] | 80 |
|
---|
[780] | 81 | // necessary types
|
---|
[2341] | 82 | #ifndef __WINE_WINDEF_H
|
---|
[780] | 83 | #ifdef ULONG
|
---|
| 84 | #error ULONG definition is bad.
|
---|
| 85 | #define ULONG nope.
|
---|
[17] | 86 | #endif
|
---|
[1616] | 87 | #ifndef NO_ULONG
|
---|
| 88 | typedef unsigned long ULONG;
|
---|
| 89 | typedef unsigned long HMODULE;
|
---|
| 90 | #endif
|
---|
[2341] | 91 | #endif //!__WINE_WINDEF_H
|
---|
[17] | 92 |
|
---|
| 93 | #ifndef SYSTEM
|
---|
| 94 | # define SYSTEM _System
|
---|
| 95 | #endif
|
---|
| 96 |
|
---|
| 97 |
|
---|
[13] | 98 | int SYSTEM WriteLog(char *tekst, ...);
|
---|
[2061] | 99 | int SYSTEM WritePrivateLog(void *logfile, char *tekst, ...);
|
---|
[924] | 100 |
|
---|
[13] | 101 | int SYSTEM WriteLogError(char *tekst, ...);
|
---|
[924] | 102 |
|
---|
[2431] | 103 | void SYSTEM DecreaseLogCount();
|
---|
| 104 | void SYSTEM IncreaseLogCount();
|
---|
| 105 |
|
---|
[4] | 106 | void SYSTEM CheckVersion(ULONG version, char *modname);
|
---|
[924] | 107 |
|
---|
[4] | 108 | void SYSTEM CheckVersionFromHMOD(ULONG version, HMODULE hModule);
|
---|
| 109 |
|
---|
[924] | 110 | int SYSTEM DebugErrorBox(ULONG iErrorCode,
|
---|
| 111 | char* pszFormat,
|
---|
| 112 | ...);
|
---|
| 113 |
|
---|
[2061] | 114 | //To use private logfiles for dlls, you must have these functions and call
|
---|
| 115 | //them when the dll is loaded (open) and the exitlist handler is called (close)
|
---|
| 116 | void OpenPrivateLogFiles();
|
---|
| 117 | void ClosePrivateLogFiles();
|
---|
[924] | 118 |
|
---|
[4] | 119 | #ifdef __cplusplus
|
---|
| 120 | }
|
---|
| 121 | #endif
|
---|
| 122 |
|
---|
[13] | 123 |
|
---|
[4] | 124 | #include "unicode.h"
|
---|
| 125 |
|
---|
| 126 | #endif
|
---|