source: trunk/include/misc.h@ 2341

Last change on this file since 2341 was 2341, checked in by sandervl, 26 years ago

header updates

File size: 2.5 KB
Line 
1/* $Id: misc.h,v 1.14 2000-01-06 20:03:03 sandervl Exp $ */
2
3/*
4 * Miscellaneous definitions
5 * Debug prototypes and macros
6 */
7
8
9#ifndef __MISC_H__
10#define __MISC_H__
11
12#if !defined(_OS2WIN_H) && !defined(__INCLUDE_WINUSER_H) && !defined(__WINE_WINBASE_H) && !defined(__WINE_WINDEF_H)
13 #include <win32type.h>
14#endif
15
16#ifdef __cplusplus
17 extern "C" {
18#endif
19
20/* enable support for the _interrupt() statement */
21#if (defined(__IBMCPP__) || defined(__IBMC__))
22# include <builtin.h>
23#endif
24
25#ifdef DEBUG
26 #define DebugInt3() _interrupt(3)
27#else
28 #define DebugInt3()
29#endif
30
31
32#ifdef DEBUG
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
44 #define dprintf(a) WriteLog a
45#endif
46 #define eprintf(a) WriteLog a ; WriteLogError a
47 #define dassert(a, b) if(!(a)) WriteLogError b
48 #define dbgCheckObj(a) a->checkObject()
49
50#ifdef DEBUG_ENABLELOG_LEVEL2
51#ifdef PRIVATE_LOGGING
52 #define dprintf2(a) WritePrivateLog a
53#else
54 #define dprintf2(a) WriteLog a
55#endif
56#else
57 #define dprintf2(a)
58#endif
59
60#else
61 #define dprintfGlobal(a)
62 #define dprintf(a)
63 #define dprintf2(a)
64 #define eprintf(a)
65 #define dassert(a, b)
66 #define dbgCheckObj(a)
67#endif
68
69
70// necessary types
71#ifndef __WINE_WINDEF_H
72#ifdef ULONG
73 #error ULONG definition is bad.
74 #define ULONG nope.
75#endif
76#ifndef NO_ULONG
77 typedef unsigned long ULONG;
78 typedef unsigned long HMODULE;
79#endif
80#endif //!__WINE_WINDEF_H
81
82#ifndef SYSTEM
83# define SYSTEM _System
84#endif
85
86
87int SYSTEM WriteLog(char *tekst, ...);
88int SYSTEM WritePrivateLog(void *logfile, char *tekst, ...);
89
90int SYSTEM WriteLogError(char *tekst, ...);
91
92void SYSTEM CheckVersion(ULONG version, char *modname);
93
94void SYSTEM CheckVersionFromHMOD(ULONG version, HMODULE hModule);
95
96int SYSTEM DebugErrorBox(ULONG iErrorCode,
97 char* pszFormat,
98 ...);
99
100//To use private logfiles for dlls, you must have these functions and call
101//them when the dll is loaded (open) and the exitlist handler is called (close)
102void OpenPrivateLogFiles();
103void ClosePrivateLogFiles();
104
105#ifdef __cplusplus
106 }
107#endif
108
109
110#include "versionos2.h"
111#include "unicode.h"
112
113#endif
Note: See TracBrowser for help on using the repository browser.