From: nhmall Date: Sun, 22 Aug 2021 23:23:09 +0000 (-0400) Subject: Windows VS build failure if DLB wasn't defined X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61ed041c9ef31193800a9c93722aa3aee0906e00;p=nethack Windows VS build failure if DLB wasn't defined --- diff --git a/include/windconf.h b/include/windconf.h index 07b6e0651..4abee7c00 100644 --- a/include/windconf.h +++ b/include/windconf.h @@ -45,7 +45,9 @@ /* #define SHORT_FILENAMES */ /* All NT filesystems support long names now */ +#ifdef DLB #define VERSION_IN_DLB_FILENAME /* Append version digits to nhdat */ +#endif #ifdef MICRO #undef MICRO /* never define this! */ @@ -213,7 +215,7 @@ extern void interject(int); #define C(c) (0x1f & (c)) #endif -#if defined(DLB) +#if defined(DLB) || defined(_MSC_VER) #define FILENAME_CMP stricmp /* case insensitive */ #endif diff --git a/sys/windows/Makefile.msc b/sys/windows/Makefile.msc index 86f8d79f3..2f4a0e157 100644 --- a/sys/windows/Makefile.msc +++ b/sys/windows/Makefile.msc @@ -231,9 +231,9 @@ WINPFLAG= -DTILES -DMSWIN_GRAPHICS -DWIN32CON USE_DLB = Y ! IF ("$(USE_DLB)"=="Y") -DLBFLG = -DDLB +DLBDEF = -DDLB ! ELSE -DLBFLG = +DLBDEF = ! ENDIF # @@ -706,7 +706,7 @@ CURSESDEF=-D"CURSES_GRAPHICS" -D"CURSES_BRIEF_INCLUDE" -DCHTYPE_32 !ENDIF ccommon= -c -nologo -D"_CONSOLE" -D"_CRT_NONSTDC_NO_DEPRECATE" -D"_CRT_SECURE_NO_DEPRECATE" \ - -D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"DLB" -D"_MBCS" \ + -D"_LIB" -D"_SCL_SECURE_NO_DEPRECATE" -D"_VC80_UPGRADE=0x0600" -D"_MBCS" \ -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -D"NDEBUG" -D"YY_NO_UNISTD_H" \ -DHAS_STDINT_H -DHAS_INLINE $(CURSESDEF) $(RUNTIMEOPTDEF) \ -EHsc -fp:precise -Gd -GF -GS -Gy \ @@ -795,8 +795,8 @@ INCLDIR= /I..\include /I..\sys\windows $(LUAINCL) # Util builds #========================================== -cflagsBuild = $(cflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) -DSAFEPROCS -cppflagsBuild = $(cppflags) $(INCLDIR) $(WINPFLAG) $(DLBFLG) -DSAFEPROCS +cflagsBuild = $(cflags) $(INCLDIR) $(WINPFLAG) $(DLBDEF) -DSAFEPROCS +cppflagsBuild = $(cppflags) $(INCLDIR) $(WINPFLAG) $(DLBDEF) -DSAFEPROCS lflagsBuild = $(lflags) $(conlibs) $(MACHINE) #========================================== @@ -930,8 +930,11 @@ default : install all : install -install: $(INCL)\nhlua.h $(O)envchk.tag $(O)obj.tag $(O)utility.tag $(GAMEDIR)\NetHack.exe $(GAMEDIR)\NetHackW.exe $(O)install.tag - @echo Done. +install: $(INCL)\nhlua.h $(O)envchk.tag $(O)obj.tag $(O)utility.tag \ + $(DAT)\data $(DAT)\rumors $(DAT)\oracles $(DAT)\engrave \ + $(DAT)\epitaph $(DAT)\bogusmon $(GAMEDIR)\NetHack.exe \ + $(GAMEDIR)\NetHackW.exe $(O)install.tag + @echo Done. #========================================== # Main game targets. @@ -1089,9 +1092,28 @@ $(O)install.tag: $(DAT)\data $(DAT)\rumors $(DAT)\oracles \ copy $(DAT)\license $(GAMEDIR) copy $(DAT)\opthelp $(GAMEDIR) ! ELSE - copy $(DAT)\*. $(GAMEDIR) - copy $(DAT)\*.dat $(GAMEDIR) - if exist $(GAMEDIR)\makefile del $(GAMEDIR)\makefile + copy $(DAT)\bogusmon $(GAMEDIR) + copy $(DAT)\cmdhelp $(GAMEDIR) + copy $(DAT)\data $(GAMEDIR) + copy $(DAT)\dungeon $(GAMEDIR) + copy $(DAT)\engrave $(GAMEDIR) + copy $(DAT)\epitaph $(GAMEDIR) + copy $(DAT)\help $(GAMEDIR) + copy $(DAT)\hh $(GAMDEDIR) + copy $(DAT)\history $(GAMEDIR) + copy $(DAT)\license $(GAMEDIR) + copy $(DAT)\oracles $(GAMEDIR) + copy $(DAT)\rumors $(GAMEDIR) + copy $(DAT)\symbols $(GAMEDIR) + copy $(DAT)\tribute $(GAMEDIR) + copy $(DAT)\wizhelp $(GAMEDIR) + copy $(DAT)\*.lua $(GAMEDIR) + if exist $(DAT)\guioptions copy $(DAT)\guioptions $(GAMEDIR) + if exist $(DAT)\keyhelp copy $(DAT)\keyhelp $(GAMEDIR) + if exist $(DAT)\opthelp copy $(DAT)\opthelp $(GAMEDIR) + if exist $(DAT)\options copy $(DAT)\options $(GAMEDIR) + if exist $(DAT)\porthelp copy $(DAT)\porthelp $(GAMEDIR) + if exist $(DAT)\ttyoptions copy $(DAT)\ttyoptions $(GAMEDIR) ! ENDIF if exist $(MSWSYS)\sysconf.template copy $(MSWSYS)\sysconf.template $(GAMEDIR) if exist $(DAT)\symbols copy $(DAT)\symbols $(GAMEDIR)\symbols.template @@ -1698,22 +1720,22 @@ $(O)alloc.o: alloc.c $(CONFIG_H) # dat dependencies # -$(DAT)\data: $(O)utility.tag $(DATABASE) +$(DAT)\data: $(U)makedefs.exe $(DATABASE) $(U)makedefs -d -$(DAT)\rumors: $(O)utility.tag $(DAT)\rumors.tru $(DAT)\rumors.fal +$(DAT)\rumors: $(U)makedefs.exe $(DAT)\rumors.tru $(DAT)\rumors.fal $(U)makedefs -r -$(DAT)\oracles: $(O)utility.tag $(DAT)\oracles.txt +$(DAT)\oracles: $(U)makedefs.exe $(DAT)\oracles.txt $(U)makedefs -h -$(DAT)\engrave: $(DAT)\engrave.txt $(U)makedefs.exe +$(DAT)\engrave: $(U)makedefs.exe $(DAT)\engrave.txt $(U)makedefs -s -$(DAT)\epitaph: $(DAT)\epitaph.txt $(U)makedefs.exe +$(DAT)\epitaph: $(U)makedefs.exe $(DAT)\epitaph.txt $(U)makedefs -s -$(DAT)\bogusmon: $(DAT)\bogusmon.txt $(U)makedefs.exe +$(DAT)\bogusmon: $(U)makedefs.exe $(DAT)\bogusmon.txt $(U)makedefs -s #=============================================================================== diff --git a/sys/windows/windmain.c b/sys/windows/windmain.c index c279e0616..78a1c48e0 100644 --- a/sys/windows/windmain.c +++ b/sys/windows/windmain.c @@ -6,7 +6,9 @@ #include "win32api.h" /* for GetModuleFileName */ #include "hack.h" +#ifdef DLB #include "dlb.h" +#endif #include #include #include @@ -497,6 +499,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ iflags.windowtype_locked = TRUE; windowtype = default_window_sys; +#ifdef DLB if (!dlb_init()) { pline("%s\n%s\n%s\n%s\n\n", copyright_banner_line(1), copyright_banner_line(2), @@ -506,6 +509,7 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ pline("\nAre you perhaps trying to run NetHack within a zip utility?"); error("dlb_init failure."); } +#endif if (!iflags.windowtype_locked) { #if defined(TTY_GRAPHICS)