https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bba03c886c830ffa6d4eb…
commit bba03c886c830ffa6d4ebe70e0c9bf34153c7dff
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Dec 14 17:40:44 2024 +0200
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Wed Jan 15 08:29:53 2025 +0200
[WIDL] Reduce diff to Wine-4.0
---
sdk/tools/widl/CMakeLists.txt | 2 +-
sdk/tools/widl/client.c | 2 +-
sdk/tools/widl/hash.c | 6 +++---
sdk/tools/widl/parser.y | 2 --
sdk/tools/widl/register.c | 25 ++++---------------------
sdk/tools/widl/widl.h | 2 --
sdk/tools/widl/write_msft.c | 10 +++++-----
7 files changed, 14 insertions(+), 35 deletions(-)
diff --git a/sdk/tools/widl/CMakeLists.txt b/sdk/tools/widl/CMakeLists.txt
index 4c0818489d0..4346c14a188 100644
--- a/sdk/tools/widl/CMakeLists.txt
+++ b/sdk/tools/widl/CMakeLists.txt
@@ -35,7 +35,7 @@ list(APPEND SOURCE
../port/getopt1.c
../port/mkstemps.c)
-add_definitions(-DINT16=SHORT)
+add_definitions(-DINT16=SHORT -DLANG_SCOTTISH_GAELIC=0x91)
add_host_tool(widl ${SOURCE})
target_link_libraries(widl PRIVATE host_includes wpphost)
diff --git a/sdk/tools/widl/client.c b/sdk/tools/widl/client.c
index 20ebd51a581..30b0dce5b8a 100644
--- a/sdk/tools/widl/client.c
+++ b/sdk/tools/widl/client.c
@@ -20,7 +20,7 @@
#include "config.h"
#include "wine/port.h"
-
+
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
diff --git a/sdk/tools/widl/hash.c b/sdk/tools/widl/hash.c
index 673625ed1e3..249c824e9e0 100644
--- a/sdk/tools/widl/hash.c
+++ b/sdk/tools/widl/hash.c
@@ -543,10 +543,10 @@ unsigned int lhash_val_of_name_sys( syskind_t skind, LCID lcid,
LPCSTR lpStr)
case LANG_VIETNAMESE: case LANG_MALTESE: case LANG_IRISH:
case LANG_SAMI: case LANG_UPPER_SORBIAN: case LANG_TSWANA:
case LANG_XHOSA: case LANG_ZULU: case LANG_WELSH:
- case LANG_BRETON: case LANG_NEUTRAL:
+ case LANG_BRETON: case LANG_SCOTTISH_GAELIC: case LANG_NEUTRAL:
/* some languages not in all windows versions or ReactOS */
-#ifdef LANG_GAELIC
- case LANG_GAELIC:
+#ifdef LANG_MANX_GAELIC
+ case LANG_MANX_GAELIC:
#endif
#ifdef LANG_TAJIK
case LANG_TAJIK:
diff --git a/sdk/tools/widl/parser.y b/sdk/tools/widl/parser.y
index 63b70e9e47c..bbb03e8ef74 100644
--- a/sdk/tools/widl/parser.y
+++ b/sdk/tools/widl/parser.y
@@ -136,9 +136,7 @@ static struct namespace global_namespace = {
static struct namespace *current_namespace = &global_namespace;
-#ifndef __REACTOS__
static typelib_t *current_typelib;
-#endif
%}
%union {
diff --git a/sdk/tools/widl/register.c b/sdk/tools/widl/register.c
index a6d1ef840f7..718d444cc7a 100644
--- a/sdk/tools/widl/register.c
+++ b/sdk/tools/widl/register.c
@@ -34,9 +34,7 @@
#include "parser.h"
#include "header.h"
#include "typegen.h"
-#ifndef __REACTOS__
#include "typelib.h"
-#endif
static int indent;
@@ -276,7 +274,6 @@ void write_regscript( const statement_list_t *stmts )
}
}
-#ifndef __REACTOS__
void write_typelib_regscript( const statement_list_t *stmts )
{
const statement_t *stmt;
@@ -289,17 +286,11 @@ void write_typelib_regscript( const statement_list_t *stmts )
if (count && !strendswith( typelib_name, ".res" ))
error( "Cannot store multiple typelibs into %s\n", typelib_name );
else
- {
- if (do_old_typelib)
- create_sltg_typelib( stmt->u.lib );
- else
- create_msft_typelib( stmt->u.lib );
- }
+ create_msft_typelib( stmt->u.lib );
count++;
}
if (count && strendswith( typelib_name, ".res" ))
flush_output_resources( typelib_name );
}
-#endif
void output_typelib_regscript( const typelib_t *typelib )
{
@@ -309,9 +300,7 @@ void output_typelib_regscript( const typelib_t *typelib )
unsigned int version = get_attrv( typelib->attrs, ATTR_VERSION );
unsigned int flags = 0;
char id_part[12] = "";
-#ifndef __REACTOS__
char *resname = typelib_name;
-#endif
expr_t *expr;
if (is_attr( typelib->attrs, ATTR_RESTRICTED )) flags |= 1; /* LIBFLAG_FRESTRICTED
*/
@@ -329,17 +318,14 @@ void output_typelib_regscript( const typelib_t *typelib )
MAJORVERSION(version), MINORVERSION(version), descr ? descr :
typelib->name );
put_str( indent++, "{\n" );
expr = get_attrp( typelib->attrs, ATTR_ID );
-#ifdef __REACTOS__
- if (expr)
- sprintf(id_part, "\\%d", expr->cval);
-#else
if (expr)
{
sprintf(id_part, "\\%d", expr->cval);
+#ifndef __REACTOS__
resname = xmalloc( strlen(typelib_name) + 20 );
sprintf(resname, "%s\\%d", typelib_name, expr->cval);
- }
#endif
+ }
put_str( indent, "'%x' { %s = s '%%MODULE%%%s' }\n",
lcid_expr ? lcid_expr->cval : 0, pointer_size == 8 ? "win64" :
"win32", id_part );
put_str( indent, "FLAGS = s '%u'\n", flags );
@@ -359,9 +345,6 @@ void output_typelib_regscript( const typelib_t *typelib )
write_progids( typelib->stmts );
put_str( --indent, "}\n" );
-#ifdef __REACTOS__
- add_output_to_resources( "WINE_REGISTRY", typelib_name );
-#else
+
add_output_to_resources( "WINE_REGISTRY", resname );
-#endif
}
diff --git a/sdk/tools/widl/widl.h b/sdk/tools/widl/widl.h
index c015ec01384..3e015ca7e13 100644
--- a/sdk/tools/widl/widl.h
+++ b/sdk/tools/widl/widl.h
@@ -96,9 +96,7 @@ extern void write_proxies(const statement_list_t *stmts);
extern void write_client(const statement_list_t *stmts);
extern void write_server(const statement_list_t *stmts);
extern void write_regscript(const statement_list_t *stmts);
-#ifndef __REACTOS__
extern void write_typelib_regscript(const statement_list_t *stmts);
-#endif
extern void output_typelib_regscript( const typelib_t *typelib );
extern void write_local_stubs(const statement_list_t *stmts);
extern void write_dlldata(const statement_list_t *stmts);
diff --git a/sdk/tools/widl/write_msft.c b/sdk/tools/widl/write_msft.c
index 88cdbc78248..2fa7e193619 100644
--- a/sdk/tools/widl/write_msft.c
+++ b/sdk/tools/widl/write_msft.c
@@ -900,7 +900,7 @@ static int encode_type(
if (typeoffset == typelib->typelib_segdir[MSFT_SEG_TYPEDESC].length) {
int mix_field;
-
+
if (target_type & 0x80000000) {
mix_field = ((target_type >> 16) & 0x3fff) | VT_BYREF;
} else {
@@ -936,7 +936,7 @@ static int encode_type(
if (typeoffset == typelib->typelib_segdir[MSFT_SEG_TYPEDESC].length) {
int mix_field;
-
+
if (target_type & 0x80000000) {
mix_field = ((target_type >> 16) & VT_TYPEMASK) | VT_ARRAY;
} else {
@@ -1551,7 +1551,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func,
int index)
}
/* update the index data */
- typeinfo->func_indices[typeinfo->typeinfo->cElement & 0xffff] = id;
+ typeinfo->func_indices[typeinfo->typeinfo->cElement & 0xffff] = id;
typeinfo->func_offsets[typeinfo->typeinfo->cElement & 0xffff] = offset;
typeinfo->func_names[typeinfo->typeinfo->cElement & 0xffff] =
name_offset;
@@ -1607,7 +1607,7 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index,
var_t* var)
unsigned int typedata_size;
INT *typedata;
unsigned int var_datawidth, var_alignment = 0;
- int var_type_size, var_kind = 0 /* VAR_PERINSTANCE */;
+ int var_type_size, var_kind = 0 /* VAR_PERINSTANCE */;
int alignment;
int varflags = 0;
const attr_t *attr;
@@ -2705,7 +2705,7 @@ int create_msft_typelib(typelib_t *typelib)
set_help_context(msft);
set_help_string_dll(msft);
set_help_string_context(msft);
-
+
/* midl adds two sets of custom data to the library: the current unix time
and midl's version number */
time_override = getenv( "WIDL_TIME_OVERRIDE");