-/* NetHack 3.5 extern.h $NHDT-Date: 1428806395 2015/04/12 02:39:55 $ $NHDT-Branch: master $:$NHDT-Revision: 1.455 $ */
+/* NetHack 3.5 extern.h $NHDT-Date: 1429135323 2015/04/15 22:02:03 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.464 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
E void NDECL(really_close);
#endif
#ifdef DEBUG
-E boolean FDECL(showdebug, (const char *));
+E boolean FDECL(debugcore, (const char *, boolean));
#endif
E void FDECL(read_tribute, (const char *,const char *,int));
-/* NetHack 3.5 hack.h $NHDT-Date: 1426465431 2015/03/16 00:23:51 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.52 $ */
+/* NetHack 3.5 hack.h $NHDT-Date: 1429136301 2015/04/15 22:18:21 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.59 $ */
/* SCCS Id: @(#)hack.h 3.5 2008/03/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* [DEBUG shouldn't be defined unless you know what you're doing...] */
#ifdef DEBUG
-# define ifdebug(stmt) do { if (showdebug(__FILE__)) stmt; } while (0)
+# define showdebug(file) debugcore(file, TRUE)
+# define explicitdebug(file) debugcore(file, FALSE)
+# define ifdebug(stmt) do { if (showdebug(__FILE__)) stmt; } while (0)
+# ifdef _MSC_VER
+ /* if we have microsoft's C runtime we can use these instead */
+# include <crtdbg.h>
+# define crtdebug(stmt) do { if (showdebug(__FILE__)) stmt; \
+ _RPT0(_CRT_WARN,"\n"); } while (0)
+# define debugpline0(str) crtdebug(_RPT0(_CRT_WARN,str))
+# define debugpline1(fmt,arg) crtdebug(_RPT1(_CRT_WARN,fmt,arg))
+# define debugpline2(fmt,a1,a2) crtdebug(_RPT2(_CRT_WARN,fmt,a1,a2))
+# define debugpline3(fmt,a1,a2,a3) crtdebug(_RPT3(_CRT_WARN,fmt,a1,a2,a3))
+# define debugpline4(fmt,a1,a2,a3,a4) crtdebug(_RPT4(_CRT_WARN,fmt,a1,a2,a3,a4))
+# else
/* these don't require compiler support for C99 variadic macros */
-# define debugpline0(str) ifdebug(pline(str))
-# define debugpline1(fmt,arg) ifdebug(pline(fmt,arg))
-# define debugpline2(fmt,a1,a2) ifdebug(pline(fmt,a1,a2))
-# define debugpline3(fmt,a1,a2,a3) ifdebug(pline(fmt,a1,a2,a3))
-# define debugpline4(fmt,a1,a2,a3,a4) ifdebug(pline(fmt,a1,a2,a3,a4))
+# define debugpline0(str) ifdebug(pline(str))
+# define debugpline1(fmt,arg) ifdebug(pline(fmt,arg))
+# define debugpline2(fmt,a1,a2) ifdebug(pline(fmt,a1,a2))
+# define debugpline3(fmt,a1,a2,a3) ifdebug(pline(fmt,a1,a2,a3))
+# define debugpline4(fmt,a1,a2,a3,a4) ifdebug(pline(fmt,a1,a2,a3,a4))
+# endif
#else
-# define debugpline0(str) /*empty*/
-# define debugpline1(fmt,arg) /*empty*/
-# define debugpline2(fmt,a1,a2) /*empty*/
-# define debugpline3(fmt,a1,a2,a3) /*empty*/
-# define debugpline4(fmt,a1,a2,a3,a4) /*empty*/
-#endif /*DEBUG*/
+# define debugpline0(str) /*empty*/
+# define debugpline1(fmt,arg) /*empty*/
+# define debugpline2(fmt,a1,a2) /*empty*/
+# define debugpline3(fmt,a1,a2,a3) /*empty*/
+# define debugpline4(fmt,a1,a2,a3,a4) /*empty*/
+#endif /*DEBUG*/
#define TELL 1
#define NOTELL 0
-/* NetHack 3.5 dungeon.c $NHDT-Date: 1426465434 2015/03/16 00:23:54 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.39 $ */
+/* NetHack 3.5 dungeon.c $NHDT-Date: 1429135381 2015/04/15 22:03:01 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.49 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
s_level *x;
branch *br;
- if (!showdebug(__FILE__)) return;
+ if (!explicitdebug(__FILE__)) return;
for(i = 0; i < n_dgns; i++) {
fprintf(stderr, "\n#%d \"%s\" (%s):\n", i,
-/* NetHack 3.5 files.c $NHDT-Date: 1427337311 2015/03/26 02:35:11 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.141 $ */
+/* NetHack 3.5 files.c $NHDT-Date: 1429136302 2015/04/15 22:18:22 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.166 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#ifdef DEBUG
/* used by debugpline() to decide whether to issue a message
- from a partiular source file; caller passes __FILE__ and we check
- whether it is in the source file list supplied by SYSCF's DEBUGFILES */
+ * from a partiular source file; caller passes __FILE__ and we check
+ * whether it is in the source file list supplied by SYSCF's DEBUGFILES
+ *
+ * pass FALSE to override wildcard matching; useful for files
+ * like dungeon.c and questpgr.c, which generate a ridiculous amount of
+ * output if DEBUG is defined and effectively block the use of a wildcard */
boolean
-showdebug(filename)
+debugcore(filename, wildcards)
const char *filename;
+boolean wildcards;
{
const char *debugfiles, *p;
* attempt a wildcard match against each element, but that would be
* overkill for the intended usage.]
*/
- if (pmatch(debugfiles, filename))
+ if (wildcards && pmatch(debugfiles, filename))
return TRUE;
/* check whether filename is an element of the list */
}
return FALSE;
}
+
#endif /*DEBUG*/
/* ---------- BEGIN TRIBUTE ----------- */
-/* NetHack 3.5 questpgr.c $NHDT-Date: 1426465439 2015/03/16 00:23:59 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.18 $ */
+/* NetHack 3.5 questpgr.c $NHDT-Date: 1429135390 2015/04/15 22:03:10 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.26 $ */
/* Copyright 1991, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
{
struct qtmsg *msg;
- if (!showdebug(__FILE__)) return;
+ if (!explicitdebug(__FILE__)) return;
for (msg = qt_list.chrole; msg->msgnum > 0; msg++) {
pline("msgnum %d: delivery %c",
-/* NetHack 3.5 pcmain.c $NHDT-Date: 1427337317 2015/03/26 02:35:17 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.52 $ */
+/* NetHack 3.5 pcmain.c $NHDT-Date: 1429135416 2015/04/15 22:03:36 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.60 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#endif
boolean resuming = FALSE; /* assume new game */
+#ifdef _MSC_VER
+ /* set these appropriately for VS debugging */
+ _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG);
+ _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_DEBUG); /* | _CRTDBG_MODE_FILE);*/
+ _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
+ /*| _CRTDBG_MODE_FILE | _CRTDBG_MODE_WNDW);*/
+ /* use STDERR by default
+ _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
+ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
+#endif
+
#if defined(__BORLANDC__) && !defined(_WIN32)
startup();
#endif
<PreprocessorDefinitions>NDEBUG;WIN32;WIN32CON;DLB;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
<SDLCheck>true</SDLCheck>\r
<StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<PrecompiledHeaderOutputFile>.\Debug/NetHack.pch</PrecompiledHeaderOutputFile>\r
<AssemblerListingLocation>.\$(ConfigurationName)\$(ProjectName)\</AssemblerListingLocation>\r
<PreprocessorDefinitions>WIN32;WIN32CON;DLB;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
<SDLCheck>true</SDLCheck>\r
<StringPooling>true</StringPooling>\r
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
<FunctionLevelLinking>true</FunctionLevelLinking>\r
<PrecompiledHeaderOutputFile>.\Debug/NetHack.pch</PrecompiledHeaderOutputFile>\r
<AssemblerListingLocation>.\$(ConfigurationName)\$(ProjectName)\</AssemblerListingLocation>\r
<ClCompile Include="..\src\worn.c" />\r
<ClCompile Include="..\src\write.c" />\r
<ClCompile Include="..\src\zap.c" />\r
+ <ClCompile Include="..\sys\share\cppregex.cpp" />\r
<ClCompile Include="..\sys\share\nhlan.c" />\r
<ClCompile Include="..\sys\share\pcmain.c" />\r
<ClCompile Include="..\sys\share\pcsys.c" />\r
<ClCompile Include="..\sys\winnt\ntsound.c" />\r
<ClCompile Include="..\sys\winnt\nttty.c" />\r
<ClCompile Include="..\sys\winnt\winnt.c" />\r
- <ClCompile Include="..\sys\share\cppregex.cpp" />\r
<ClCompile Include="..\win\tty\getline.c" />\r
<ClCompile Include="..\win\tty\topl.c" />\r
<ClCompile Include="..\win\tty\wintty.c" />\r
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
</ClCompile>\r
+ <ClCompile Include="..\sys\share\cppregex.cpp" />\r
<ClCompile Include="..\win\tty\getline.c">\r
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r