Define TRUE only if it hasn't been defined before
[reactos.git] / reactos / tools / widl / widl_ros.diff
1 Index: hash.c
2 ===================================================================
3 --- hash.c (revision 32187)
4 +++ hash.c (working copy)
5 @@ -21,9 +21,7 @@
6 #include <stdio.h>
7 #include <stdarg.h>
8
9 -#include "windef.h"
10 -#include "winbase.h"
11 -#include "winnls.h"
12 +#include <host/nls.h>
13
14 #include "hash.h"
15
16 @@ -535,6 +533,7 @@
17 case LANG_SWEDISH: case LANG_SYRIAC: case LANG_TAMIL:
18 case LANG_TATAR: case LANG_TELUGU: case LANG_THAI:
19 case LANG_UKRAINIAN: case LANG_URDU: case LANG_UZBEK:
20 +#ifndef __REACTOS__
21 case LANG_VIETNAMESE: case LANG_GAELIC: case LANG_MALTESE:
22 case LANG_TAJIK: case LANG_ROMANSH: case LANG_IRISH:
23 case LANG_SAMI: case LANG_UPPER_SORBIAN: case LANG_SUTU:
24 @@ -542,6 +541,12 @@
25 case LANG_XHOSA: case LANG_ZULU: case LANG_ESPERANTO:
26 case LANG_WALON: case LANG_CORNISH: case LANG_WELSH:
27 case LANG_BRETON:
28 +#else
29 + case LANG_VIETNAMESE: case LANG_MALTESE: case LANG_IRISH:
30 + case LANG_SAMI: case LANG_UPPER_SORBIAN: case LANG_TSWANA:
31 + case LANG_XHOSA: case LANG_ZULU: case LANG_WELSH:
32 + case LANG_BRETON:
33 +#endif
34 nOffset = 16;
35 pnLookup = Lookup_16;
36 break;
37 Index: server.c
38 ===================================================================
39 --- server.c (revision 32187)
40 +++ server.c (working copy)
41 @@ -390,6 +390,7 @@
42 print_server("/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name);
43 print_server("#include <string.h>\n");
44 fprintf(server, "\n");
45 + print_server("#define _SEH_NO_NATIVE_NLG\n");
46 print_server("#include \"%s\"\n", header_name);
47 fprintf(server, "\n");
48 }
49 Index: typelib.c
50 ===================================================================
51 --- typelib.c (revision 32187)
52 +++ typelib.c (working copy)
53 @@ -35,8 +35,7 @@
54 #define NONAMELESSUNION
55 #define NONAMELESSSTRUCT
56
57 -#include "windef.h"
58 -#include "winbase.h"
59 +#include <host/typedefs.h>
60
61 #include "widl.h"
62 #include "utils.h"
63 Index: widl.c
64 ===================================================================
65 --- widl.c (revision 32187)
66 +++ widl.c (working copy)
67 @@ -174,7 +174,7 @@
68 token = xstrdup(name);
69 for (i=0; token[i]; i++) {
70 if (!isalnum(token[i])) token[i] = '_';
71 - else token[i] = toupper(token[i]);
72 + else token[i] = tolower(token[i]);
73 }
74 return token;
75 }
76 @@ -561,8 +561,8 @@
77 fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name);
78 fprintf(header, "#include <rpc.h>\n" );
79 fprintf(header, "#include <rpcndr.h>\n\n" );
80 - fprintf(header, "#ifndef __WIDL_%s\n", header_token);
81 - fprintf(header, "#define __WIDL_%s\n", header_token);
82 + fprintf(header, "#ifndef __%s__\n", header_token);
83 + fprintf(header, "#define __%s__\n", header_token);
84 start_cplusplus_guard(header);
85 }
86
87 @@ -606,7 +606,7 @@
88 fprintf(header, "/* End additional prototypes */\n");
89 fprintf(header, "\n");
90 end_cplusplus_guard(header);
91 - fprintf(header, "#endif /* __WIDL_%s */\n", header_token);
92 + fprintf(header, "#endif /* __%s__ */\n", header_token);
93 fclose(header);
94 }
95 Index: widltypes.h
96 ===================================================================
97 --- widltypes.h (revision 32187)
98 +++ widltypes.h (working copy)
99 @@ -21,6 +21,13 @@
100 #ifndef __WIDL_WIDLTYPES_H
101 #define __WIDL_WIDLTYPES_H
102
103 +#define S_OK 0
104 +#define S_FALSE 1
105 +#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
106 +#define TYPE_E_IOERROR ((HRESULT)0x80028CA2L)
107 +
108 +#define max(a, b) ((a) > (b) ? a : b)
109 +
110 #include <stdarg.h>
111 #include "guiddef.h"
112 #include "wine/rpcfc.h"
113 @@ -38,7 +38,9 @@
114 typedef GUID UUID;
115 #endif
116
117 +#ifndef TRUE
118 #define TRUE 1
119 +#endif
120 #define FALSE 0
121
122 typedef struct _attr_t attr_t;
123 Index: write_msft.c
124 ===================================================================
125 --- write_msft.c (revision 32187)
126 +++ write_msft.c (working copy)
127 @@ -40,10 +40,8 @@
128 #define NONAMELESSUNION
129 #define NONAMELESSSTRUCT
130
131 -#include "winerror.h"
132 -#include "windef.h"
133 -#include "winbase.h"
134 -#include "winnls.h"
135 +#include <host/typedefs.h>
136 +#include <host/nls.h>
137
138 #include "widltypes.h"
139 #include "typelib.h"