unsigned long incarnation; /* actual version number */
unsigned long feature_set; /* bitmask of config settings */
unsigned long entity_count; /* # of monsters and objects */
-#ifndef WASM
+#ifndef __EMSCRIPTEN__
unsigned long struct_sizes1; /* size of key structs */
unsigned long struct_sizes2; /* size of more key structs */
-#else /* WASM */
+#else /* __EMSCRIPTEN__ */
/* 'long' in WASM is 4 bytes, which is too small to hold version numbers
* such as: VERSION_SANITY2 */
unsigned long long struct_sizes1; /* size of key structs */
unsigned long long struct_sizes2; /* size of more key structs */
-#endif /* !WASM */
+#endif /* !__EMSCRIPTEN__ */
};
struct savefile_info {
/* PANICTRACE: Always defined for NH_DEVEL_STATUS != NH_STATUS_RELEASED
but only for supported platforms. */
-#if defined(UNIX) && !defined(WASM)
+#if defined(UNIX) && !defined(__EMSCRIPTEN__)
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
/* see end.c */
#ifndef PANICTRACE
#if defined(MACOSX)
#define PANICTRACE_LIBC
#endif
-#if defined(UNIX) && !defined(WASM) /* no popen in WASM */
+#if defined(UNIX) && !defined(__EMSCRIPTEN__) /* no popen in WASM */
#define PANICTRACE_GDB
#endif
CXX = $(CXX_V$(QUIETCC))
CFLAGS+=-I../include
-ifdef WANT_WASM
-CFLAGS+=-DWASM
-endif
# LD and LINK might be based on invoking CC and may not be able to substitute
# for QUIETCC, so feedback from them is handled differently (via $AT)
EMCC_LFLAGS+=-s ALLOW_TABLE_GROWTH
EMCC_LFLAGS+=-s ASYNCIFY -s ASYNCIFY_IMPORTS='["_nhmain"]' -O3
EMCC_LFLAGS+=-s MODULARIZE
-EMCC_LFLAGS+=-s EXPORTED_FUNCTIONS='["_main"]'
+EMCC_LFLAGS+=-s EXPORTED_FUNCTIONS='["_main", "_stub_graphics_set_callback"]'
EMCC_LFLAGS+=-s EXPORTED_RUNTIME_METHODS='["cwrap", "ccall", "addFunction", "removeFunction", "UTF8ToString"]'
EMCC_LFLAGS+=-s ERROR_ON_UNDEFINED_SYMBOLS=0
EMCC_LFLAGS+=--embed-file wasm-data@/
# WASM C flags
EMCC_CFLAGS=
EMCC_CFLAGS+=-Wall -Werror
-EMCC_CFLAGS+=-DWASM
EMCC_DEBUG_CFLAGS+=-s ASSERTIONS=1
EMCC_DEBUG_CFLAGS+=-s STACK_OVERFLOW_CHECK=2
EMCC_DEBUG_CFLAGS+=-s SAFE_HEAP=1
#endif
Fprintf(ofp, "#define VERSION_SANITY1 0x%08lx%s\n", version.entity_count,
ul_sfx);
-#ifndef WASM
+#ifndef __EMSCRIPTEN__
Fprintf(ofp, "#define VERSION_SANITY2 0x%08lx%s\n", version.struct_sizes1,
ul_sfx);
Fprintf(ofp, "#define VERSION_SANITY3 0x%08lx%s\n", version.struct_sizes2,
ul_sfx);
-#else /* WASM */
+#else /* __EMSCRIPTEN__ */
Fprintf(ofp, "#define VERSION_SANITY2 0x%08llx%s\n", version.struct_sizes1,
ul_sfx);
Fprintf(ofp, "#define VERSION_SANITY3 0x%08llx%s\n", version.struct_sizes2,
ul_sfx);
-#endif /* !WASM */
+#endif /* !__EMSCRIPTEN__ */
Fprintf(ofp, "\n");
Fprintf(ofp, "#define VERSION_STRING \"%s\"\n", version_string(buf, "."));