Support nested structures
[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: typegen.c
50 ===================================================================
51 --- typegen.c (revision 32187)
52 +++ typegen.c (working copy)
53 @@ -3299,8 +3299,9 @@
54 print_file(file, 0, "static void __RPC_USER %s_%sExprEval_%04u(PMIDL_STUB_MESSAGE pStubMsg)\n",
55 iface, name, callback_offset);
56 print_file(file, 0, "{\n");
57 - print_file (file, 1, "%s *%s = (%s *)(pStubMsg->StackTop - %u);\n",
58 - name, var_name, name, eval->baseoff);
59 + print_file (file, 1, "%s%s *%s = (%s%s *)(pStubMsg->StackTop - %u);\n",
60 + is_struct(eval->structure->type) ? "struct " : "", name, var_name,
61 + is_struct(eval->structure->type) ? "struct " : "", name, eval->baseoff);
62 print_file(file, 1, "pStubMsg->Offset = 0;\n"); /* FIXME */
63 print_file(file, 1, "pStubMsg->MaxCount = (unsigned long)");
64 write_struct_expr(file, eval->expr, 1, fields, var_name);
65 Index: typelib.c
66 ===================================================================
67 --- typelib.c (revision 32187)
68 +++ typelib.c (working copy)
69 @@ -35,8 +35,7 @@
70 #define NONAMELESSUNION
71 #define NONAMELESSSTRUCT
72
73 -#include "windef.h"
74 -#include "winbase.h"
75 +#include <host/typedefs.h>
76
77 #include "widl.h"
78 #include "utils.h"
79 Index: widl.c
80 ===================================================================
81 --- widl.c (revision 32187)
82 +++ widl.c (working copy)
83 @@ -174,7 +174,7 @@
84 token = xstrdup(name);
85 for (i=0; token[i]; i++) {
86 if (!isalnum(token[i])) token[i] = '_';
87 - else token[i] = toupper(token[i]);
88 + else token[i] = tolower(token[i]);
89 }
90 return token;
91 }
92 @@ -561,8 +561,8 @@
93 fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name);
94 fprintf(header, "#include <rpc.h>\n" );
95 fprintf(header, "#include <rpcndr.h>\n\n" );
96 - fprintf(header, "#ifndef __WIDL_%s\n", header_token);
97 - fprintf(header, "#define __WIDL_%s\n", header_token);
98 + fprintf(header, "#ifndef __%s__\n", header_token);
99 + fprintf(header, "#define __%s__\n", header_token);
100 start_cplusplus_guard(header);
101 }
102
103 @@ -606,7 +606,7 @@
104 fprintf(header, "/* End additional prototypes */\n");
105 fprintf(header, "\n");
106 end_cplusplus_guard(header);
107 - fprintf(header, "#endif /* __WIDL_%s */\n", header_token);
108 + fprintf(header, "#endif /* __%s__ */\n", header_token);
109 fclose(header);
110 }
111 Index: widltypes.h
112 ===================================================================
113 --- widltypes.h (revision 32187)
114 +++ widltypes.h (working copy)
115 @@ -21,6 +21,13 @@
116 #ifndef __WIDL_WIDLTYPES_H
117 #define __WIDL_WIDLTYPES_H
118
119 +#define S_OK 0
120 +#define S_FALSE 1
121 +#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
122 +#define TYPE_E_IOERROR ((HRESULT)0x80028CA2L)
123 +
124 +#define max(a, b) ((a) > (b) ? a : b)
125 +
126 #include <stdarg.h>
127 #include "guiddef.h"
128 #include "wine/rpcfc.h"
129 Index: write_msft.c
130 ===================================================================
131 --- write_msft.c (revision 32187)
132 +++ write_msft.c (working copy)
133 @@ -40,10 +40,8 @@
134 #define NONAMELESSUNION
135 #define NONAMELESSSTRUCT
136
137 -#include "winerror.h"
138 -#include "windef.h"
139 -#include "winbase.h"
140 -#include "winnls.h"
141 +#include <host/typedefs.h>
142 +#include <host/nls.h>
143
144 #include "widltypes.h"
145 #include "typelib.h"