Skip to content

Commit

Permalink
[WIDL] Reduce diff to Wine-4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tkreuzer committed Dec 16, 2024
1 parent eda529d commit 45b1a01
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 35 deletions.
2 changes: 1 addition & 1 deletion sdk/tools/widl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion sdk/tools/widl/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "config.h"
#include "wine/port.h"

#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
Expand Down
6 changes: 3 additions & 3 deletions sdk/tools/widl/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions sdk/tools/widl/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
25 changes: 4 additions & 21 deletions sdk/tools/widl/register.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
#include "parser.h"
#include "header.h"
#include "typegen.h"
#ifndef __REACTOS__
#include "typelib.h"
#endif

static int indent;

Expand Down Expand Up @@ -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;
Expand All @@ -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 )
{
Expand All @@ -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 */
Expand All @@ -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 );
Expand All @@ -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
}
2 changes: 0 additions & 2 deletions sdk/tools/widl/widl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions sdk/tools/widl/write_msft.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit 45b1a01

Please sign in to comment.