00001 
00002 
00003 
00004 
00009 #ifndef __HEADER_H__
00010 #define __HEADER_H__
00011 
00013 
00014 #include "config.h"
00015 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 
00040 
00041 
00042 
00044 
00045 #define __K4CONF_H__    // skip section in "mk4.h", since we use "header.h"
00046 
00047     
00048 #if !q4_MFC && !q4_STD && !defined (q4_UNIV)
00049 #define q4_UNIV 1
00050 #endif
00051 
00053 
00054 
00055 
00056 #if defined (__MINGW32__)
00057 #define d4_OS_H "win.h"
00058 #elif defined (MSDOS) && defined (__GNUC__)
00059 #define q4_DOS 1
00060 #elif defined(unix) || defined(__unix__) || defined(__GNUC__) || \
00061         defined(_AIX) || defined(__hpux)
00062 #define q4_UNIX 1
00063 #elif defined (__VMS)
00064 #define q4_VMS 1
00065 #elif defined (macintosh)
00066 #define q4_MAC 1
00067 #elif !defined (d4_OS_H)
00068 #define d4_OS_H "win.h"
00069 #endif
00070 
00072 
00073 
00074 #if defined (_M_I86) || defined (_M_IX86) || defined (i386)
00075 #define q4_I86 1
00076 #if defined (_M_I86SM)
00077 #define q4_TINY 1
00078 #endif
00079 #elif defined (__powerc)
00080 #define q4_PPC 1
00081 #elif defined (__alpha)
00082 #define q4_AXP 1
00083 #define q4_LONG64 1
00084 #elif defined (__VMS)
00085 #define q4_VAX 1
00086 #else
00087 #define q4_M68K 1
00088 #endif
00089 
00091 
00092 
00093 
00094 #if defined (__BORLANDC__)                  // Borland C++
00095 #include "borc.h"
00096 #elif defined (__DECCXX)                    // DEC C++
00097 #define q4_DECC 1
00098 #elif defined (__GNUC__)                    // GNU C++
00099 #include "gnuc.h"
00100 #elif defined (__MWERKS__)                  // Metrowerks CodeWarrior C++
00101 #include "mwcw.h"
00102 #elif defined (_MSC_VER)                    // Microsoft Visual C++
00103 #include "msvc.h"
00104 #elif defined (__SC__)                      // Symantec C++
00105 #define q4_SYMC 1
00106 #elif defined (__WATCOMC__)                 // Watcom C++
00107 #define q4_WATC 1
00108 #endif
00109 
00111 
00112 
00113 #if !q4_BOOL && !q4_STD         // define a bool datatype
00114 #define false 0
00115 #define true 1
00116 #define bool int
00117 #endif
00118 
00119 #if !q4_CHECK                   // disable assertions
00120 #undef d4_assert
00121 #define d4_dbgdef(x)
00122 #define d4_assert(x)
00123 #endif
00124 
00125 #if q4_NO_NS                    // don't use namespaces
00126 #define d4_std
00127 #else
00128 #define d4_std std
00129 #endif
00130 
00131 #if HAVE_MEMMOVE
00132 #define d4_memmove(d,s,n)   memmove(d,s,n)
00133 #elif HAVE_BCOPY
00134 #define d4_memmove(d,s,n)   bcopy(s,d,n)
00135 #else
00136 #define d4_memmove f4_memmove
00137 extern void f4_memmove(void* d, const void* s, int n);
00138 #endif
00139 
00140 typedef unsigned char t4_byte;  
00141 
00142 #if SIZEOF_LONG == 8
00143 typedef int t4_i32;             
00144 #else
00145 typedef long t4_i32;            
00146 #endif
00147 
00149 
00150 
00151 #ifdef d4_OS_H                  // operating system dependencies
00152 #include d4_OS_H
00153 #endif
00154 
00156 
00157 
00158 #ifndef d4_assert               // assertion macro
00159 #include <assert.h>
00160 #define d4_assert assert
00161 #endif
00162 
00163 #ifndef d4_dbgdef               // conditionally compiled
00164 #ifdef NDEBUG
00165 #define d4_dbgdef(x)
00166 #else
00167 #define d4_dbgdef(x) x
00168 #endif
00169 #endif
00170 
00171 #ifndef d4_new                  // heap allocator
00172 #define d4_new new
00173 #endif
00174 
00175 #ifndef d4_reentrant            // thread-local storage
00176 #define d4_reentrant
00177 #endif
00178 
00180 
00181 
00182 #if q4_LOGPROPMODS
00183 void f4_DoLogProp(const c4_Handler*, int, const char*, int);
00184 #else
00185 #define f4_LogPropMods(a,b) 0
00186 #endif
00187 
00189 
00190 
00191 #include "mk4.h"
00192 
00193 #if q4_MFC
00194 #include "mfc.h"
00195 #elif q4_STD
00196 #include "std.h"
00197 #elif q4_UNIV
00198 #include "univ.h"
00199 #endif
00200 
00201 #ifdef _MSC_VER
00202 #pragma warning(disable: 4100 4127 4135 4244 4511 4512 4514)
00203 #endif
00204 
00205 #include <string.h>
00206 
00208 
00209 
00210 #if !q4_FIX
00211 #if (q4_DOS+q4_MAC+q4_UNIX+q4_VMS+q4_WIN) != 1
00212 #error Exactly one operating system should have been defined
00213 #endif
00214 #if (q4_MFC+q4_STD+q4_UNIV) != 1
00215 #error Exactly one container library should have been defined
00216 #endif
00217 #endif
00218     
00220 
00221 #endif