[WIDL] Minor cleanups following wine-10.0 sync (#8461)

Addendum to commit 8608467b84 (PR #8305).

- Remove redundant `#ifndef __REACTOS__ ... #endif` inside such an
  already existing block.
  See https://github.com/reactos/reactos/pull/8305#discussion_r2510118529

- Move the `getenv("TEMP")` ReactOS-specific fix to a better place.

- Reduce diff with respect to what we had prior to the sync.
  See https://github.com/reactos/reactos/pull/8305#discussion_r2509976210
This commit is contained in:
Hermès Bélusca-Maïto
2025-11-17 13:20:38 +01:00
parent f2c0b5f40c
commit 87226107f4
3 changed files with 5 additions and 11 deletions
+4 -8
View File
@@ -382,14 +382,6 @@ static inline char *make_temp_dir(void)
char *name;
const char *tmpdir = NULL;
#ifdef __REACTOS__
#ifdef _WIN32
if (!(tmpdir = getenv("TEMP"))) tmpdir = "temp";
#else
if (!(tmpdir = getenv("TMPDIR"))) tmpdir = "/tmp";
#endif
#endif
for (count = 0; count < 0x8000; count++)
{
if (tmpdir)
@@ -400,7 +392,11 @@ static inline char *make_temp_dir(void)
value += 7777;
if (errno == EACCES && !tmpdir)
{
#if defined(__REACTOS__) && defined(_WIN32)
if (!(tmpdir = getenv("TEMP"))) tmpdir = "temp";
#else
if (!(tmpdir = getenv("TMPDIR"))) tmpdir = "/tmp";
#endif
}
free( name );
}
+1 -1
View File
@@ -2157,7 +2157,7 @@ static type_t *reg_typedefs( struct location where, decl_spec_t *decl_spec, decl
type->attrs = attrs;
}
#ifdef __REACTOS__ /* r53187 / 5bf224e */
#ifdef __REACTOS__ /* r53187 / 5bf224e */
/* Append the SWITCHTYPE attribute to a non-encapsulated union if it does not already have it. */
if (type_get_type_detect_alias(type) == TYPE_UNION &&
is_attr(attrs, ATTR_SWITCHTYPE) &&
-2
View File
@@ -686,13 +686,11 @@ int open_typelib( const char *name )
TRYOPEN( strmake( "%s/wine%s/%s", libdir, pe_dir, name ));
TRYOPEN( strmake( "%s/wine/%s", libdir, name ));
}
#ifndef __REACTOS__
for (i = 0; i < ARRAY_SIZE(default_dirs); i++)
{
if (i && !strcmp( default_dirs[i], default_dirs[0] )) continue;
TRYOPEN( strmake( "%s%s/%s", default_dirs[i], pe_dir, name ));
}
#endif
}
#endif