CROSS_TO_WASM build fixes

This commit is contained in:
nhmall
2026-05-03 07:37:13 -04:00
parent c2a7bdb369
commit 1947eb98a4
2 changed files with 30 additions and 4 deletions
+2 -2
View File
@@ -2050,7 +2050,7 @@ problematic_savefile(int sfstatus, const char *savefilenm)
/* ---------- BEGIN EXTERNAL CONVERSION HANDLING ----------- */
static boolean cvtinit = FALSE;
/* static boolean cvtinit = FALSE; */
#ifndef SFCTOOL
static char *unconverted_filename = 0, *converted_filename = 0;
@@ -2171,7 +2171,7 @@ free_convert_filenames(void)
free((genericptr_t) converted_filename), converted_filename = 0;
if (unconverted_filename)
free((genericptr_t) unconverted_filename), unconverted_filename = 0;
cvtinit = FALSE;
/* cvtinit = FALSE; */
}
/* return TRUE if s contains a directory, not just a filespec */
+28 -2
View File
@@ -51,7 +51,7 @@ extern void init_linux_cons(void);
static void wd_message(void);
static struct passwd *get_unix_pw(void);
ATTRNORETURN static void opt_terminate(void) NORETURN;
/* ATTRNORETURN static void opt_terminate(void) NORETURN; */
#ifdef __EMSCRIPTEN__
/* if WebAssembly, export this API and don't optimize it out */
@@ -769,6 +769,8 @@ sys_random_seed(void)
return seed;
}
#if 0
/* now found in earlyarg.c */
/* for command-line options that perform some immediate action and then
terminate the program without starting play, like 'nethack --version'
or 'nethack -s Zelda'; do some cleanup before that termination */
@@ -780,7 +782,6 @@ opt_terminate(void)
nh_terminate(EXIT_SUCCESS);
/*NOTREACHED*/
}
/* show the sysconf file name, playground directory, run-time configuration
file name, dumplog file name if applicable, and some other things */
ATTRNORETURN void
@@ -794,6 +795,31 @@ after_opt_showpaths(const char *dir)
opt_terminate();
/*NOTREACHED*/
}
#endif
void
get_nhuuid(void)
{
unsigned char stmp[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
if (svn.nhuuid[0])
return;
/* FIXME: fill in a useful valid UUID somehow */
Snprintf(svn.nhuuid, sizeof svn.nhuuid, "%s", (char *) stmp);
}
void
free_nhuuid(void)
{
int i;
for (i = 0; i < SIZE(svn.nhuuid); i++) {
svn.nhuuid[i] = 0;
}
}
#ifdef __EMSCRIPTEN__
/***