From 2965ce4bc51c4cb78a08567aa206dbc48a1b7434 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sun, 15 Dec 2024 09:53:50 -0500 Subject: [PATCH] msdos build correction ENHANCED_SYMBOLS is defined by default in config.h. The msdos build tried to #undef ENHANCED_SYMBOLS in tilemap.c, but doing it in there created a mismatch between the data struct definition for glyph_map in wintype.h and the initializers generated in tilemap.c Move the msdos build catch for ENHANCED_SYMBOLS to one single place in config1.h so that the code and data agree. --- include/config1.h | 4 ++++ include/wintty.h | 2 +- sys/msdos/video.c | 9 +++++++++ win/share/tilemap.c | 4 ---- win/tty/wintty.c | 6 ------ 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/include/config1.h b/include/config1.h index c4e14610c..3a8632564 100644 --- a/include/config1.h +++ b/include/config1.h @@ -31,6 +31,10 @@ #ifndef CROSSCOMPILE #define SHORT_FILENAMES #endif +/* this is not fully-implemented yet for msdos */ +#ifdef ENHANCED_SYMBOLS +#undef ENHANCED_SYMBOLS +#endif #endif /* diff --git a/include/wintty.h b/include/wintty.h index 87183708e..ec29c112b 100644 --- a/include/wintty.h +++ b/include/wintty.h @@ -210,7 +210,7 @@ extern void docorner(int, int, int); extern void end_glyphout(void); extern void g_putch(int); #ifdef ENHANCED_SYMBOLS -#if defined(WIN32) || defined(UNIX) +#if defined(WIN32) || defined(UNIX) || defined(MSDOS) extern void g_pututf8(uint8 *); #endif #endif /* ENHANCED_SYMBOLS */ diff --git a/sys/msdos/video.c b/sys/msdos/video.c index 6397fa8d8..ae03e2541 100644 --- a/sys/msdos/video.c +++ b/sys/msdos/video.c @@ -14,6 +14,7 @@ */ #include "hack.h" +#include "wintty.h" #ifndef STUBVIDEO #include "pcvideo.h" @@ -88,6 +89,14 @@ get_scr_size(void) txt_get_scr_size(); } +#ifdef ENHANCED_SYMBOLS +void g_pututf8(uint8 *utf8str) +{ + /* not implemented for msdos (yet) */ + nhUse(utf8str); +} +#endif + /* * -------------------------------------------------------------- * The rest of this file is only compiled if NO_TERMS is defined. diff --git a/win/share/tilemap.c b/win/share/tilemap.c index ec26f513b..4842fc7a8 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -54,10 +54,6 @@ extern void exit(int); #endif #endif -#if defined(CROSSCOMPILE) && defined(ENHANCED_SYMBOLS) -#undef ENHANCED_SYMBOLS -#endif - struct { int idx; const char *tilelabel; diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 693592fbb..207f396ac 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -27,12 +27,6 @@ extern void msmsg(const char *, ...); #endif #endif -#ifdef MSDOS -#ifdef ENHANCED_SYMBOLS -#undef ENHANCED_SYMBOLS -#endif -#endif /* MSDOS */ - #ifndef NO_TERMS #include "tcap.h" #endif