Revert 45697:
[reactos.git] / 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_t)(Size))
20 #define ZEROMEMORY(Area, Size) memset((Area), '\0', (size_t)(Size))
21 #define MEMCPY(Dest, Src, Size) memcpy((Dest), (Src), (size_t)(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 typedef const TCHAR *PCTSTR;
32
33 #define _T(x) x
34 #define _tcsicmp strcasecmp
35 #define _tcslen strlen
36 #define _tcscpy strcpy
37 #define _tcstoul strtoul
38 #define _tcstol strtol
39 #define STRFMT "%s"
40
41 #ifdef _MSC_VER
42 #define strcasecmp _stricmp
43 #endif
44
45 #else /* ! defined(INFLIB_HOST) */
46
47 /* ReactOS definitions */
48
49 #define UNICODE
50 #define _UNICODE
51 #define WIN32_NO_STATUS
52 #include <windows.h>
53 #define NTOS_MODE_USER
54 #include <ndk/ntndk.h>
55 #include <tchar.h>
56
57 extern PVOID InfpHeap;
58
59 #define FREE(Area) RtlFreeHeap(InfpHeap, 0, (Area))
60 #define MALLOC(Size) RtlAllocateHeap(InfpHeap, 0, (Size))
61 #define ZEROMEMORY(Area, Size) RtlZeroMemory((Area), (Size))
62 #define MEMCPY(Dest, Src, Size) RtlCopyMemory((Dest), (Src), (Size))
63
64 #define INF_STATUS_SUCCESS STATUS_SUCCESS
65 #define INF_STATUS_NO_MEMORY STATUS_NO_MEMORY
66 #define INF_STATUS_INVALID_PARAMETER STATUS_INVALID_PARAMETER
67 #define INF_STATUS_NOT_FOUND STATUS_NOT_FOUND
68 #define INF_STATUS_BUFFER_OVERFLOW STATUS_BUFFER_OVERFLOW
69 #define INF_SUCCESS(x) (0 <= (x))
70
71 #define STRFMT "%S"
72
73 #endif /* INFLIB_HOST */
74
75 /* EOF */