msvc compatibility
[reactos.git] / reactos / lib / inflib / builddep.h
1 /*
2 * PROJECT: .inf file parser
3 * LICENSE: GPL - See COPYING in the top level directory
4 * COPYRIGHT: Copyright 2005 Ge van Geldorp <gvg@reactos.org>
5 */
6
7 #ifdef INFLIB_HOST
8
9 /* Definitions native to the host on which we're building */
10
11 #include <stdarg.h>
12 #include <stdio.h>
13 #include <string.h>
14 #include <errno.h>
15
16 #define FALSE 0
17 #define TRUE 1
18
19 #define FREE(Area) free(Area)
20 #define MALLOC(Size) malloc(Size)
21 #define ZEROMEMORY(Area, Size) memset((Area), '\0', (Size))
22 #define MEMCPY(Dest, Src, Size) memcpy((Dest), (Src), (Size))
23
24 #define INF_STATUS_SUCCESS 0
25 #define INF_STATUS_NO_MEMORY ENOMEM
26 #define INF_STATUS_INVALID_PARAMETER EINVAL
27 #define INF_STATUS_NOT_FOUND ENOENT
28 #define INF_STATUS_BUFFER_OVERFLOW E2BIG
29 #define INF_SUCCESS(x) (0 == (x))
30
31 typedef char CHAR, *PCHAR;
32 typedef unsigned char UCHAR, *PUCHAR;
33 typedef long LONG, *PLONG;
34 typedef unsigned long ULONG, *PULONG;
35 typedef void VOID, *PVOID;
36 typedef UCHAR BOOLEAN, *PBOOLEAN;
37
38 typedef char TCHAR, *PTCHAR, *PTSTR;
39 #define _T(x) x
40 #define _tcsicmp strcasecmp
41 #define _tcslen strlen
42 #define _tcscpy strcpy
43 #define _tcstoul strtoul
44 #define _tcstol strtol
45 #define STRFMT "%s"
46
47 #ifdef _MSC_VER
48 #define strcasecmp stricmp
49 #endif
50
51 extern unsigned long DbgPrint(char *Fmt, ...);
52
53 #else /* ! defined(INFLIB_HOST) */
54
55 /* ReactOS definitions */
56
57 #define UNICODE
58 #define _UNICODE
59 #include <tchar.h>
60 #define WIN32_NO_STATUS
61 #include <windows.h>
62 #define NTOS_MODE_USER
63 #include <ndk/ntndk.h>
64
65 extern PVOID InfpHeap;
66
67 #define FREE(Area) RtlFreeHeap(InfpHeap, 0, (Area))
68 #define MALLOC(Size) RtlAllocateHeap(InfpHeap, 0, (Size))
69 #define ZEROMEMORY(Area, Size) RtlZeroMemory((Area), (Size))
70 #define MEMCPY(Dest, Src, Size) RtlCopyMemory((Dest), (Src), (Size))
71
72 #define INF_STATUS_SUCCESS STATUS_SUCCESS
73 #define INF_STATUS_NO_MEMORY STATUS_NO_MEMORY
74 #define INF_STATUS_INVALID_PARAMETER STATUS_INVALID_PARAMETER
75 #define INF_STATUS_NOT_FOUND STATUS_NOT_FOUND
76 #define INF_STATUS_BUFFER_OVERFLOW STATUS_BUFFER_OVERFLOW
77 #define INF_SUCCESS(x) (0 <= (x))
78
79 #define STRFMT "%S"
80
81 #endif /* INFLIB_HOST */
82
83 typedef const TCHAR *PCTSTR;
84
85 /* EOF */