From 6cec6a88a54351ca72a5b430cebd195deacc2f70 Mon Sep 17 00:00:00 2001 From: Bart House Date: Sat, 15 Dec 2018 17:35:27 -0800 Subject: [PATCH 1/7] Added PDCurses project to VS 2017 build. --- win/win32/vs2017/NetHack.sln | 10 +++ win/win32/vs2017/NetHack.vcxproj | 2 +- win/win32/vs2017/PDCurses.vcxproj | 120 +++++++++++++++++++++++++++++ win/win32/vs2017/default_lib.props | 17 ++++ 4 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 win/win32/vs2017/PDCurses.vcxproj create mode 100644 win/win32/vs2017/default_lib.props diff --git a/win/win32/vs2017/NetHack.sln b/win/win32/vs2017/NetHack.sln index a64b1cba1..8c9e1e701 100644 --- a/win/win32/vs2017/NetHack.sln +++ b/win/win32/vs2017/NetHack.sln @@ -78,6 +78,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nhraykey", "nhraykey.vcxpro {BA3DD34C-04B7-40D0-B373-9329AA9E8945} = {BA3DD34C-04B7-40D0-B373-9329AA9E8945} EndProjectSection EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PDCurses", "PDCurses.vcxproj", "{BAA70D0F-3EC7-4D10-91F0-974F1F49308B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -190,6 +192,14 @@ Global {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Release|Win32.Build.0 = Release|Win32 {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Release|x64.ActiveCfg = Release|x64 {2E1F4BB3-3BD7-43AD-8E64-D3B8A2F5D7B2}.Release|x64.Build.0 = Release|x64 + {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Debug|Win32.ActiveCfg = Debug|Win32 + {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Debug|Win32.Build.0 = Debug|Win32 + {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Debug|x64.ActiveCfg = Debug|x64 + {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Debug|x64.Build.0 = Debug|x64 + {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Release|Win32.ActiveCfg = Release|Win32 + {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Release|Win32.Build.0 = Release|Win32 + {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Release|x64.ActiveCfg = Release|x64 + {BAA70D0F-3EC7-4D10-91F0-974F1F49308B}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/win/win32/vs2017/NetHack.vcxproj b/win/win32/vs2017/NetHack.vcxproj index 1e114f64f..d5feb73b7 100644 --- a/win/win32/vs2017/NetHack.vcxproj +++ b/win/win32/vs2017/NetHack.vcxproj @@ -22,7 +22,7 @@ CURSES_GRAPHICS;%(PreprocessorDefinitions) - $(PDCURSES)\bin\$(Platform)\$(Configuration)\ + $(ToolsDir) PDCurses.lib;%(AdditionalDependencies) diff --git a/win/win32/vs2017/PDCurses.vcxproj b/win/win32/vs2017/PDCurses.vcxproj new file mode 100644 index 000000000..e77f33b6a --- /dev/null +++ b/win/win32/vs2017/PDCurses.vcxproj @@ -0,0 +1,120 @@ + + + + + {BAA70D0F-3EC7-4D10-91F0-974F1F49308B} + Win32Proj + PDCurses + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(PDCURSES);$(IncludePath) + + + + NotUsing + Level3 + true + true + 4996;4244;%(DisableSpecificWarnings) + MultiThreadedDebug + true + + + Windows + true + + + + + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug + + + + + Disabled + _DEBUG;_LIB;%(PreprocessorDefinitions) + + + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + + + true + true + + + + + MaxSpeed + true + true + NDEBUG;_LIB;%(PreprocessorDefinitions) + + + true + true + + + + \ No newline at end of file diff --git a/win/win32/vs2017/default_lib.props b/win/win32/vs2017/default_lib.props new file mode 100644 index 000000000..61bf2ecaa --- /dev/null +++ b/win/win32/vs2017/default_lib.props @@ -0,0 +1,17 @@ + + + + StaticLibrary + false + MultiByte + v141 + + + true + + + false + true + + + From 1b0719a8cc072bfae01ad42ac85ec67a60b844e9 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 15 Dec 2018 21:52:00 -0500 Subject: [PATCH 2/7] Makefile.msc update Tell people where to find the latest PDCurses git repository --- sys/winnt/Makefile.msc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index 21817c661..e88aa7781 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -73,8 +73,8 @@ DEBUGINFO = Y # PDCurses header (.h) files and PDCURSES_C to the location # of your PDCurses C files. # -#ADD_CURSES=Y -#PDCURSES_TOP=..\..\pdcurses +ADD_CURSES=Y +PDCURSES_TOP=..\..\pdcurses # #============================================================================== # This marks the end of the BUILD DECISIONS section. @@ -287,9 +287,10 @@ ALLOBJ = $(SOBJ) $(DLBOBJ) $(WOBJ) $(OBJS) $(VVOBJ) OPTIONS_FILE = $(DAT)\options !IF "$(ADD_CURSES)" == "Y" -#========================================== +#===============-================================================= # PDCurses build macros -#========================================== +# Latest PDCurses from https://github.com/wmcbrine/PDCurses.git +#================================================================= PDCURSES_CURSES_H = $(PDCURSES_TOP)\curses.h PDCURSES_CURSPRIV_H = $(PDCURSES_TOP)\curspriv.h From 31c4eba8351a19b7d7a8db55aff986bc7ef521f9 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 15 Dec 2018 22:03:05 -0500 Subject: [PATCH 3/7] Guidebook bit --- doc/Guidebook.mn | 6 +++--- doc/Guidebook.tex | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index e696ec13f..db16a8423 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -24,7 +24,7 @@ .ds vr "NetHack 3.6 .ds f0 "\*(vr .ds f1 -.ds f2 "November 29, 2018 +.ds f2 "December 15, 2018 . .\" A note on some special characters: .\" \(lq = left double quote @@ -4934,8 +4934,8 @@ again to \fBM. Drew Streib\fP and \fBPasi Kallinen\fP for providing a public NetHack server at nethack.alt.org. Thanks to \fBKeith Simpson\fP and \fBAndy Thomson\fP for hardfought.org. Thanks to all those unnamed dungeoneers who invest their time and effort into annual -NetHack tournaments such as Junethack and in days past, -devnull.net (gone for now, but not forgotten). +NetHack tournaments such as Junethack, The November NetHack Tournament +and in days past, devnull.net (gone for now, but not forgotten). .pg .ce - - - - - - - - - -\ \ \ \ \" when centered, the dashes look a little too far diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index daeefcf7c..57be65355 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -45,7 +45,7 @@ %.au \author{Original version - Eric S. Raymond\\ (Edited and expanded for 3.6 by Mike Stephenson and others)} -\date{November 29, 2018} +\date{December 15, 2018} \maketitle @@ -5508,7 +5508,8 @@ again to {\it M. Drew Streib} and {\it Pasi Kallinen} for providing a public NetHack server at nethack.alt.org. Thanks to {\it Keith Simpson} and {\it Andy Thomson} for hardfought.org. Thanks to all those unnamed dungeoneers who invest their time and effort into annual -{\it NetHack\/} tournaments such as {\it Junethack} and in days past, +{\it NetHack\/} tournaments such as {\it Junethack}, +{\it The November NetHack Tournament} and in days past, {\it devnull.net\/} (gone for now, but not forgotten). \clearpage From 1b1ea19e57ccd0c5bc4235b389ff829316e765a5 Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 15 Dec 2018 22:04:55 -0500 Subject: [PATCH 4/7] comment out PDCurses bt default again --- sys/winnt/Makefile.msc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/winnt/Makefile.msc b/sys/winnt/Makefile.msc index e88aa7781..19f406a52 100644 --- a/sys/winnt/Makefile.msc +++ b/sys/winnt/Makefile.msc @@ -73,8 +73,8 @@ DEBUGINFO = Y # PDCurses header (.h) files and PDCURSES_C to the location # of your PDCurses C files. # -ADD_CURSES=Y -PDCURSES_TOP=..\..\pdcurses +#ADD_CURSES=Y +#PDCURSES_TOP=..\..\pdcurses # #============================================================================== # This marks the end of the BUILD DECISIONS section. From dddbb669279e5ccff8bedcea17df43e2fa86ac69 Mon Sep 17 00:00:00 2001 From: PatR Date: Sat, 15 Dec 2018 19:27:08 -0800 Subject: [PATCH 5/7] building lev_comp with USE_OLDARGS The relatively recent change to lev_comp do deal with apparent junk in some places in its generated data has triggered a bunch of "cast to 'vA' (aka 'const char *') from smaller integer type 'int' [-Wint-to-pointer-cast]" from clang when building with USE_OLDARGS. Probably should have added a zillion explicit casts to long and 'L' suffix for 0 rather than trying to handle both int and long. Or maybe just turned off that particular warning, which must be coming from -Wall or -Wextra. This modification has no effect for USE_STDARG or USE_VARARGS configs. --- include/sp_lev.h | 81 ++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/include/sp_lev.h b/include/sp_lev.h index 804fbc632..e38244b34 100644 --- a/include/sp_lev.h +++ b/include/sp_lev.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 sp_lev.h $NHDT-Date: 1543371689 2018/11/28 02:21:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.24 $ */ +/* NetHack 3.6 sp_lev.h $NHDT-Date: 1544930819 2018/12/16 03:26:59 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.25 $ */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -487,11 +487,15 @@ struct lc_breakdef { */ #ifdef SPEC_LEV /* compiling lev_comp rather than nethack */ +/* clang format off */ #ifdef USE_OLDARGS #ifndef VA_TYPE typedef const char *vA; #define VA_TYPE #endif +/* hack to avoid "warning: cast to 'vA' (aka 'const char *') from smaller + integer type 'int' [-Wint-to-pointer-cast]" */ +#define vA_(a) ((vA) (long) a) #undef VA_ARGS /* redefine with the maximum number actually used */ #undef VA_SHIFT /* ditto */ #undef VA_PASS1 @@ -506,51 +510,48 @@ typedef const char *vA; arg11 = arg12, arg12 = arg13, arg13 = arg14, arg14 = 0) /* standard NULL may be either (void *)0 or plain 0, both of which would need to be explicitly cast to (char *) here */ -#define VA_PASS1(a1) \ - (vA) a1, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, \ - (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0 -#define VA_PASS2(a1, a2) \ - (vA) a1, (vA) a2, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, \ - (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0 -#define VA_PASS3(a1, a2, a3) \ - (vA) a1, (vA) a2, (vA) a3, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, \ - (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0 -#define VA_PASS4(a1, a2, a3, a4) \ - (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) 0, (vA) 0, (vA) 0, (vA) 0, \ - (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0 -#define VA_PASS5(a1, a2, a3, a4, a5) \ - (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) 0, (vA) 0, (vA) 0, \ - (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0 -#define VA_PASS7(a1, a2, a3, a4, a5, a6, a7) \ - (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) a6, (vA) a7, (vA) 0, \ - (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0 -#define VA_PASS8(a1, a2, a3, a4, a5, a6, a7, a8) \ - (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) a6, (vA) a7, (vA) a8, \ - (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0 -#define VA_PASS9(a1, a2, a3, a4, a5, a6, a7, a8, a9) \ - (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) a6, (vA) a7, (vA) a8, \ - (vA) a9, (vA) 0, (vA) 0, (vA) 0, (vA) 0, (vA) 0 -#define VA_PASS14(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, \ - a14) \ - (vA) a1, (vA) a2, (vA) a3, (vA) a4, (vA) a5, (vA) a6, (vA) a7, (vA) a8, \ - (vA) a9, (vA) a10, (vA) a11, (vA) a12, (vA) a13, (vA) a14 +#define VA_PASS1(a1) \ + vA_(a1), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), \ + vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) +#define VA_PASS2(a1,a2) \ + vA_(a1), vA_(a2), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), \ + vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) +#define VA_PASS3(a1,a2,a3) \ + vA_(a1), vA_(a2), vA_(a3), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), \ + vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) +#define VA_PASS4(a1,a2,a3,a4) \ + vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(0), vA_(0), vA_(0), vA_(0), \ + vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) +#define VA_PASS5(a1,a2,a3,a4,a5) \ + vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(0), vA_(0), vA_(0), \ + vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) +#define VA_PASS7(a1,a2,a3,a4,a5,a6,a7) \ + vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(0), \ + vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) +#define VA_PASS8(a1,a2,a3,a4,a5,a6,a7,a8) \ + vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(a8), \ + vA_(0), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) +#define VA_PASS9(a1,a2,a3,a4,a5,a6,a7,a8,a9) \ + vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(a8), \ + vA_(a9), vA_(0), vA_(0), vA_(0), vA_(0), vA_(0) +#define VA_PASS14(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \ + vA_(a1), vA_(a2), vA_(a3), vA_(a4), vA_(a5), vA_(a6), vA_(a7), vA_(a8), \ + vA_(a9), vA_(a10), vA_(a11), vA_(a12), vA_(a13), vA_(a14) #else /*!USE_OLDARGS*/ /* USE_STDARG and USE_VARARGS don't need to pass dummy arguments or cast real ones */ #define VA_PASS1(a1) a1 -#define VA_PASS2(a1, a2) a1, a2 -#define VA_PASS3(a1, a2, a3) a1, a2, a3 -#define VA_PASS4(a1, a2, a3, a4) a1, a2, a3, a4 -#define VA_PASS5(a1, a2, a3, a4, a5) a1, a2, a3, a4, a5 -#define VA_PASS7(a1, a2, a3, a4, a5, a6, a7) a1, a2, a3, a4, a5, a6, a7 -#define VA_PASS8(a1, a2, a3, a4, a5, a6, a7, a8) \ - a1, a2, a3, a4, a5, a6, a7, a8 -#define VA_PASS9(a1, a2, a3, a4, a5, a6, a7, a8, a9) \ - a1, a2, a3, a4, a5, a6, a7, a8, a9 -#define VA_PASS14(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, \ - a14) \ +#define VA_PASS2(a1,a2) a1, a2 +#define VA_PASS3(a1,a2,a3) a1, a2, a3 +#define VA_PASS4(a1,a2,a3,a4) a1, a2, a3, a4 +#define VA_PASS5(a1,a2,a3,a4,a5) a1, a2, a3, a4, a5 +#define VA_PASS7(a1,a2,a3,a4,a5,a6,a7) a1, a2, a3, a4, a5, a6, a7 +#define VA_PASS8(a1,a2,a3,a4,a5,a6,a7,a8) a1, a2, a3, a4, a5, a6, a7, a8 +#define VA_PASS9(a1,a2,a3,a4,a5,a6,a7,a8,a9) a1, a2, a3, a4, a5, a6, a7, a8, a9 +#define VA_PASS14(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14) \ a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14 #endif /*?USE_OLDARGS*/ +/* clang format on */ /* You were warned to avert your eyes.... */ #endif /*SPEC_LEV*/ From 9de6c25e7e03900c2be634f18331f3bfd0eadaaf Mon Sep 17 00:00:00 2001 From: nhmall Date: Sat, 15 Dec 2018 22:36:24 -0500 Subject: [PATCH 6/7] clean exit on window port init failure --- src/windows.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/windows.c b/src/windows.c index 7326dd7a2..ad7b91b0d 100644 --- a/src/windows.c +++ b/src/windows.c @@ -294,7 +294,8 @@ const char *s; s, buf); } - if (windowprocs.win_raw_print == def_raw_print) + if (windowprocs.win_raw_print == def_raw_print + || WINDOWPORT("safe-startup")) nh_terminate(EXIT_SUCCESS); } From 6ae5931a63c764a0435eea49cc6a60cd199c7324 Mon Sep 17 00:00:00 2001 From: Bart House Date: Sat, 15 Dec 2018 19:52:58 -0800 Subject: [PATCH 7/7] Updateda PDCurses Visual Studio project to latest PDCurses content. --- win/win32/vs2017/PDCurses.vcxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/win/win32/vs2017/PDCurses.vcxproj b/win/win32/vs2017/PDCurses.vcxproj index e77f33b6a..1365917ca 100644 --- a/win/win32/vs2017/PDCurses.vcxproj +++ b/win/win32/vs2017/PDCurses.vcxproj @@ -23,7 +23,6 @@ - @@ -48,7 +47,6 @@ -