- Sync up Mm interface with WinLdr branch (introduce the concept of a memory type...
[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 <host/typedefs.h>
12
13 #include <stdarg.h>
14 #include <stdio.h>
15 #include <string.h>
16 #include <errno.h>
17
18 #define FREE(Area) free(Area)
19 #define MALLOC(Size) malloc(Size)
20 #define ZEROMEMORY(Area, Size) memset((Area), '\0', (Size))
21 #define MEMCPY(Dest, Src, Size) memcpy((Dest), (Src), (Size))
22
23 #define INF_STATUS_SUCCESS 0
24 #define INF_STATUS_NO_MEMORY ENOMEM
25 #define INF_STATUS_INVALID_PARAMETER EINVAL
26 #define INF_STATUS_NOT_FOUND ENOENT
27 #define INF_STATUS_BUFFER_OVERFLOW E2BIG
28 #define INF_SUCCESS(x) (0 == (x))
29
30 typedef char TCHAR, *PTCHAR, *PTSTR;
31 #define _T(x) x
32 #define _tcsicmp strcasecmp
33 #define _tcslen strlen
34 #define _tcscpy strcpy
35 #define _tcstoul strtoul
36 #define _tcstol strtol
37 #define STRFMT "%s"
38
39 #ifdef _MSC_VER
40 #define strcasecmp _stricmp
41 #endif
42
43 #else /* ! defined(INFLIB_HOST) */
44
45 /* ReactOS definitions */
46
47 #define UNICODE
48 #define _UNICODE
49 #include <tchar.h>
50 #define WIN32_NO_STATUS
51 #include <windows.h>
52 #define NTOS_MODE_USER
53 #include <ndk/ntndk.h>
54
55 extern PVOID InfpHeap;
56
57 #define FREE(Area) RtlFreeHeap(InfpHeap, 0, (Area))
58 #define MALLOC(Size) RtlAllocateHeap(InfpHeap, 0, (Size))
59 #define ZEROMEMORY(Area, Size) RtlZeroMemory((Area), (Size))
60 #define MEMCPY(Dest, Src, Size) RtlCopyMemory((Dest), (Src), (Size))
61
62 #define INF_STATUS_SUCCESS STATUS_SUCCESS
63 #define INF_STATUS_NO_MEMORY STATUS_NO_MEMORY
64 #define INF_STATUS_INVALID_PARAMETER STATUS_INVALID_PARAMETER
65 #define INF_STATUS_NOT_FOUND STATUS_NOT_FOUND
66 #define INF_STATUS_BUFFER_OVERFLOW STATUS_BUFFER_OVERFLOW
67 #define INF_SUCCESS(x) (0 <= (x))
68
69 #define STRFMT "%S"
70
71 #endif /* INFLIB_HOST */
72
73 typedef const TCHAR *PCTSTR;
74
75 /* EOF */