source: trunk/include/misc.h@ 3989

Last change on this file since 3989 was 3989, checked in by sandervl, 25 years ago

removed versionos2.h dependancy

File size: 2.7 KB
RevLine 
[3989]1/* $Id: misc.h,v 1.16 2000-08-11 09:57:49 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>
23#endif
24
[4]25#ifdef DEBUG
[13]26 #define DebugInt3() _interrupt(3)
[4]27#else
[13]28 #define DebugInt3()
[4]29#endif
30
31
32#ifdef DEBUG
[2061]33#ifdef PRIVATE_LOGGING
34 //To use private dll logging, define PRIVATE_LOGGING and
35 //add Open/ClosePrivateLogFiles (see below) functions to the dll
36 //to open close the private logfile. The logfile handle should
37 //be stored in the _privateLogFile variable
38 //dprintf can be called like this:
39 //dprintf((LOG, "PE file : %s", szFileName));
40 #define LOG (void*)_privateLogFile
41 #define dprintf(a) WritePrivateLog a
42 #define dprintfGlobal(a) WriteLog a
43#else
[13]44 #define dprintf(a) WriteLog a
[2061]45#endif
[13]46 #define eprintf(a) WriteLog a ; WriteLogError a
47 #define dassert(a, b) if(!(a)) WriteLogError b
48 #define dbgCheckObj(a) a->checkObject()
[2431]49 #define DisableLogging DecreaseLogCount
50 #define EnableLogging IncreaseLogCount
[1669]51
52#ifdef DEBUG_ENABLELOG_LEVEL2
[2061]53#ifdef PRIVATE_LOGGING
54 #define dprintf2(a) WritePrivateLog a
[4]55#else
[2061]56 #define dprintf2(a) WriteLog a
57#endif
58#else
[1669]59 #define dprintf2(a)
60#endif
61
62#else
[2061]63 #define dprintfGlobal(a)
[13]64 #define dprintf(a)
[1953]65 #define dprintf2(a)
[13]66 #define eprintf(a)
67 #define dassert(a, b)
68 #define dbgCheckObj(a)
[2431]69 #define DisableLogging
70 #define EnableLogging
[4]71#endif
72
[17]73
[780]74// necessary types
[2341]75#ifndef __WINE_WINDEF_H
[780]76#ifdef ULONG
77 #error ULONG definition is bad.
78 #define ULONG nope.
[17]79#endif
[1616]80#ifndef NO_ULONG
81 typedef unsigned long ULONG;
82 typedef unsigned long HMODULE;
83#endif
[2341]84#endif //!__WINE_WINDEF_H
[17]85
86#ifndef SYSTEM
87# define SYSTEM _System
88#endif
89
90
[13]91int SYSTEM WriteLog(char *tekst, ...);
[2061]92int SYSTEM WritePrivateLog(void *logfile, char *tekst, ...);
[924]93
[13]94int SYSTEM WriteLogError(char *tekst, ...);
[924]95
[2431]96void SYSTEM DecreaseLogCount();
97void SYSTEM IncreaseLogCount();
98
[4]99void SYSTEM CheckVersion(ULONG version, char *modname);
[924]100
[4]101void SYSTEM CheckVersionFromHMOD(ULONG version, HMODULE hModule);
102
[924]103int SYSTEM DebugErrorBox(ULONG iErrorCode,
104 char* pszFormat,
105 ...);
106
[2061]107//To use private logfiles for dlls, you must have these functions and call
108//them when the dll is loaded (open) and the exitlist handler is called (close)
109void OpenPrivateLogFiles();
110void ClosePrivateLogFiles();
[924]111
[4]112#ifdef __cplusplus
113 }
114#endif
115
[13]116
[4]117#include "unicode.h"
118
119#endif
Note: See TracBrowser for help on using the repository browser.