4
#ifndef WIN32_LEAN_AND_MEAN
5
#define WIN32_LEAN_AND_MEAN 1
9
#include <cassert> // (assert.h)
10
#include <cctype> // (ctype.h)
11
#include <cerrno> // (errno.h)
12
#include <cfloat> // (float.h)
13
#include <ciso646> // (iso646.h)
14
#include <climits> // (limits.h)
15
#include <clocale> // (locale.h)
16
#include <cmath> // (math.h)
17
#include <csetjmp> // (setjmp.h)
18
//#include <csignal> // (signal.h)
19
#include <cstdarg> // (stdarg.h)
20
#include <cstddef> // (stddef.h)
21
#include <cstdio> // (stdio.h)
22
#include <cstdlib> // (stdlib.h)
23
#include <cstring> // (string.h)
24
#include <ctime> // (time.h)
25
#include <cwchar> // (wchar.h)
26
#include <cwctype> // (wctype.h)
29
#include <sys/utime.h>
30
#include <sys/timeb.h>
31
#include <sys/types.h>
41
// If INL_LOG_FILE_ANSI is set to 1, log files will be written in ASCII characters even when in UNICODE.
42
#define INL_LOG_FILE_ANSI 1
44
// Undo any Windows defines.
58
// Undef Windows min and max. Conflict with std::min, std::max.
64
#define INL_VARARGS __cdecl // Functions with variable arguments
67
// This is the default calling convention for C and C++ programs.
68
// Because the stack is cleaned up by the caller, it can do vararg functions.
69
// Argument-passing order: Right to left
70
#define INL_CDECL __cdecl
71
// The __stdcall calling convention is used to call Win32 API functions.
72
// The callee cleans the stack, so the compiler makes vararg functions __cdecl.
73
// Argument-passing order: Right to left
74
#define INL_STDCALL __stdcall
75
// The __fastcall calling convention specifies that arguments to functions are to be passed in registers, when possible.
76
#define INL_FASTCALL __fastcall
77
// This is the default calling convention used by C++ member functions that do not use variable arguments.
78
// Under thiscall, the callee cleans the stack, which is impossible for vararg functions.
79
#define INL_THISCALL thiscall //
81
#define INL_INLINE inline // Force inline code
82
#define INL_FORCEINLINE __forceinline // Force inline code
83
#define INL_FORCENOINLINE __declspec(noinline) // Force code to NOT be inline
86
// Unsigned base types.
87
typedef unsigned char BYTE; // 8-bit unsigned.
88
typedef unsigned short WORD; // 16-bit unsigned.
89
typedef unsigned int UINT; // 32-bit unsigned.
90
typedef unsigned long DWORD; // 32-bit unsigned.
91
typedef unsigned __int64 QWORD; // 64-bit unsigned.
94
typedef signed char SBYTE; // 8-bit signed.
95
typedef signed short SWORD; // 16-bit signed.
96
typedef signed int INT; // 32-bit signed.
97
typedef signed __int64 SQWORD; // 64-bit signed.
101
typedef char ANSICHAR; // An ANSI character.
102
typedef unsigned char ANSIUCHAR; // An ANSI character.
103
typedef wchar_t UNICHAR; // A unicode character. L"Hello" is of type wchar_t and should not be confuse with type unsigned short on windows.
106
typedef int BOOL; // Boolean 0 (false) or 1 (true).
107
typedef long UBOOL; // Boolean 0 (false) or 1 (true).
108
typedef float FLOAT; // 32-bit IEEE floating point.
109
typedef double DOUBLE; // 64-bit IEEE double.
111
///////////////////////////////////////////////
113
///////////////////////////////////////////////
115
#ifndef _TCHAR_DEFINED
116
typedef wchar_t TCHAR;
119
#ifndef _TEXT_DEFINED
125
#ifndef _TCHAR_DEFINED
126
typedef ANSICHAR TCHAR;
133
// #ifdef WIN32_SECURE
134
// #define STRNCPY_S(strDest, numberOfElements, strSource, count) strncpy_s(strDest, numberOfElements, strSource, count)
135
// #define WCSNCPY_S(strDest, numberOfElements, strSource, count) wcsncpy_s(strDest, numberOfElements, strSource, count)
136
// #define MBSNCPY_S(strDest, numberOfElements, strSource, count) _mbsncpy_s(strDest, numberOfElements, strSource, count)
137
// #define _TCSNCPY_S(strDest, numberOfElements, strSource, count) _tcsncpy_s(strDest, numberOfElements, strSource, count)
139
// #define STRCPY_S(strDest, numberOfElements, strSource) strcpy_s(strDest, numberOfElements, strSource)
140
// #define WCSCPY_S(strDest, numberOfElements, strSource) wcscpy_s(strDest, numberOfElements, strSource)
141
// #define MBSCPY_S(strDest, numberOfElements, strSource) _mbscpy_s(strDest, numberOfElements, strSource)
142
// #define _TCSCPY_S(strDest, numberOfElements, strSource) _tcscpy_s(strDest, numberOfElements, strSource)
144
// #define STRCAT_S(strDest, numberOfElements, strSource) strcat_s(strDest, numberOfElements, strSource)
145
// #define WCSCAT_S(strDest, numberOfElements, strSource) wcscat_s(strDest, numberOfElements, strSource)
146
// #define MBSCAT_S(strDest, numberOfElements, strSource) _mbscat_s(strDest, numberOfElements, strSource)
148
// #define _VSNPRINTF_S(strDest, numberOfElements, Count, Format, VA_Arg_List) _vsnprintf_s(strDest, numberOfElements, Count, Format, VA_Arg_List)
149
// #define _VSNTPRINTF_S(strDest, numberOfElements, Count, Format, VA_Arg_List) _vsntprintf_s(strDest, numberOfElements, Count, Format, VA_Arg_List)
150
// #define SPRINTF_S(strDest, numberOfElements, Format, ...) sprintf_s(strDest, numberOfElements, Format, ##__VA_ARGS__)
151
// #define _SNPRINTF_S(strDest, numberOfElements, Count, Format, ...) _snprintf_s(strDest, numberOfElements, Count, Format, ##__VA_ARGS__)
153
// #define STRDATE_S(strDest, numberOfElements) _strdate_s(strDest, numberOfElements)
154
// #define _TSTRDATE_S(strDest, numberOfElements) _tstrdate_s(strDest, numberOfElements)
155
// #define _STRTIME_S(strDest, numberOfElements) _strtime_s(strDest, numberOfElements)
156
// #define _TSTRTIME_S(strDest, numberOfElements) _tstrtime_s(strDest, numberOfElements)
158
// #define FOPEN_S(file, filename, mode) fopen_s(file, filename, mode)
160
// #define _TCSNLEN(str, numberOfElements) _tcsnlen(str)
162
// #define _TSPLITPATH(path, Drive, DriveNumElements, Dir, DirNumElements, Filename, FileNumElements, Extension, ExtNumElements) _tsplitpath_s(path, Drive, DriveNumElements, Dir, DirNumElements, Filename, FileNumElements, Extension, ExtNumElements)
163
// #define _TMAKEPATH_S(path, numberOfElements, Drive, Dir, Filename, Extension) _tmakepath_s(path, numberOfElements, Drive, Dir, Filename, Extension)
165
// #define SSCANF_S(buffer, Format, ...) sscanf_s(buffer, Format, ##__VA_ARGS__)
166
// #define SWSCANF_S(buffer, Format, ...) swscanf_s(buffer, Format, ##__VA_ARGS__)
169
// #define STRNCPY_S(strDest, numberOfElements, strSource, count) strncpy(strDest, strSource, count)
170
// #define WCSNCPY_S(strDest, numberOfElements, strSource, count) wcsncpy(strDest, strSource, count)
171
// #define MBSNCPY_S(strDest, numberOfElements, strSource, count) _mbsncpy(strDest, strSource, count)
172
// #define _TCSNCPY_S(strDest, numberOfElements, strSource, count) _tcsncpy(strDest, strSource, count)
174
// #define STRCPY_S(strDest, numberOfElements, strSource) strcpy(strDest, strSource)
175
// #define WCSCPY_S(strDest, numberOfElements, strSource) wcscpy(strDest, strSource)
176
// #define MBSCPY_S(strDest, numberOfElements, strSource) _mbscpy(strDest, strSource)
177
// #define _TCSCPY_S(strDest, numberOfElements, strSource) _tcscpy(strDest, strSource)
179
// #define STRCAT_S(strDest, numberOfElements, strSource) strcat(strDest, strSource)
180
// #define WCSCAT_S(strDest, numberOfElements, strSource) wcscat(strDest, strSource)
181
// #define MBSCAT_S(strDest, numberOfElements, strSource) _mbscat(strDest, strSource)
183
// #define _VSNPRINTF_S(strDest, numberOfElements, Count, Format, VA_Arg_List) _vsnprintf(strDest, Count, Format, VA_Arg_List)
184
// #define _VSNTPRINTF_S(strDest, numberOfElements, Count, Format, VA_Arg_List) _vsntprintf(strDest, Count, Format, VA_Arg_List)
185
// #define SPRINTF_S(strDest, numberOfElements, Format, a,b,c,d,e,f,g,h,i,j,k,l) sprintf(strDest, Format, VARG(a),VARG(b),VARG(c),VARG(d),VARG(e),VARG(f),VARG(g),VARG(h),VARG(i),VARG(j),VARG(k),VARG(l))
186
// #define _SNPRINTF_S(strDest, numberOfElements, Count, Format, a,b,c,d,e,f,g,h,i,j,k,l) _snprintf(strDest, Count, Format, VARG(a),VARG(b),VARG(c),VARG(d),VARG(e),VARG(f),VARG(g),VARG(h),VARG(i),VARG(j),VARG(k),VARG(l))
188
// #define STRDATE_S(strDest, numberOfElements) _strdate(strDest)
189
// #define _TSTRDATE_S(strDest, numberOfElements) _tstrdate(strDest)
190
// #define _STRTIME_S(strDest, numberOfElements) _strtime(strDest)
191
// #define _TSTRTIME_S(strDest, numberOfElements) _tstrtime(strDest)
193
// #define FOPEN_S(file, filename, mode) (file=fopen(filename, mode))
195
// #define _TCSNLEN(str, numberOfElements) _tcsclen(str)
197
// #define _TSPLITPATH(path, Drive, DriveNumElements, Dir, DirNumElements, Filename, FileNumElements, Extension, ExtNumElements) _tsplitpath(path, Drive, Dir, Filename, Extension)
198
// #define _TMAKEPATH_S(path, numberOfElements, Drive, Dir, Filename, Extension) _makepath(path, Drive, Dir, Filename, Extension)
200
// #define SSCANF_S(buffer, Format, VA_Arg_List) sscanf(buffer, Format, VA_Arg_List)
201
// #define SWSCANF_S(buffer, Format, VA_Arg_List) swscanf(buffer, Format, VA_Arg_List)
204
///////////////////////////////////////////////
205
// Variable argument functions //
206
///////////////////////////////////////////////
208
//@note: Currently xutility breaks with this enabled 2005 fixes it
209
#pragma warning(disable : 4619) // #pragma warning : there is no warning number 'number'
210
//#pragma warning(disable : 4267) // #pragma warning : conversion from 'size_t' to 'int', possible loss of data
213
// Unwanted VC++ level 4 warnings to disable.
214
#pragma warning(disable : 4100) // unreferenced formal parameter
215
#pragma warning(disable : 4127) // Conditional expression is constant
216
#pragma warning(disable : 4200) // Zero-length array item at end of structure, a VC-specific extension
217
#pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
218
#pragma warning(disable : 4244) // conversion to float, possible loss of data
219
#pragma warning(disable : 4245) // conversion from 'enum ' to 'unsigned long', signed/unsigned mismatch
220
#pragma warning(disable : 4251) // needs to have dll-interface to be used by clients of class 'ULinker'
221
#pragma warning(disable : 4275) // non dll-interface class used as base for dll-interface class
222
#pragma warning(disable : 4291) // typedef-name '' used as synonym for class-name ''
223
#pragma warning(disable : 4324) // structure was padded due to __declspec(align())
224
#pragma warning(disable : 4355) // this used in base initializer list
225
#pragma warning(disable : 4389) // signed/unsigned mismatch
226
#pragma warning(disable : 4511) // copy constructor could not be generated
227
#pragma warning(disable : 4512) // assignment operator could not be generated
228
#pragma warning(disable : 4514) // unreferenced inline function has been removed
229
#pragma warning(disable : 4699) // creating precompiled header
230
#pragma warning(disable : 4702) // unreachable code in inline expanded function
231
#pragma warning(disable : 4710) // inline function not expanded
232
#pragma warning(disable : 4711) // function selected for autmatic inlining
233
#pragma warning(disable : 4714) // __forceinline function not expanded
238
void* GetDllHandle( const TCHAR* DllName );
240
void FreeDllHandle( void* DllHandle );
242
void* GetDllExport( void* DllHandle, const TCHAR* ExportName );
247
#endif // SYSTEMWIN32_H