windows build fix without DEBUG defined

This commit is contained in:
nhmall
2015-12-02 23:29:18 -05:00
parent e78e393a81
commit 945d2d21a4
2 changed files with 13 additions and 6 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 pcmain.c $NHDT-Date: 1434999947 2015/06/22 19:05:47 $ $NHDT-Branch: master $:$NHDT-Revision: 1.65 $ */ /* NetHack 3.6 pcmain.c $NHDT-Date: 1449116934 2015/12/03 04:28:54 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.66 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -123,6 +123,7 @@ char *argv[];
boolean resuming = FALSE; /* assume new game */ boolean resuming = FALSE; /* assume new game */
#ifdef _MSC_VER #ifdef _MSC_VER
# ifdef DEBUG
/* set these appropriately for VS debugging */ /* set these appropriately for VS debugging */
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_DEBUG);
_CrtSetReportMode(_CRT_ERROR, _CrtSetReportMode(_CRT_ERROR,
@@ -132,6 +133,7 @@ char *argv[];
/* use STDERR by default /* use STDERR by default
_CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR);
_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
# endif
#endif #endif
#if defined(__BORLANDC__) && !defined(_WIN32) #if defined(__BORLANDC__) && !defined(_WIN32)
+10 -5
View File
@@ -1,4 +1,4 @@
/* NetHack 3.6 mswproc.c $NHDT-Date: 1433806620 2015/06/08 23:37:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.90 $ */ /* NetHack 3.6 mswproc.c $NHDT-Date: 1449116947 2015/12/03 04:29:07 $ $NHDT-Branch: win32-x64-working $:$NHDT-Revision: 1.93 $ */
/* Copyright (C) 2001 by Alex Kompel */ /* Copyright (C) 2001 by Alex Kompel */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -31,9 +31,11 @@
#define NHTRACE_LOG "nhtrace.log" #define NHTRACE_LOG "nhtrace.log"
#ifdef _DEBUG #ifdef DEBUG
# ifdef _DEBUG
static FILE* _s_debugfp = NULL; static FILE* _s_debugfp = NULL;
extern void logDebug(const char *fmt, ...); extern void logDebug(const char *fmt, ...);
# endif
#else #else
void void
logDebug(const char *fmt, ...) logDebug(const char *fmt, ...)
@@ -132,11 +134,13 @@ mswin_init_nhwindows(int *argc, char **argv)
UNREFERENCED_PARAMETER(argc); UNREFERENCED_PARAMETER(argc);
UNREFERENCED_PARAMETER(argv); UNREFERENCED_PARAMETER(argv);
#ifdef _DEBUG #ifdef DEBUG
# ifdef _DEBUG
if (showdebug(NHTRACE_LOG) && !_s_debugfp) { if (showdebug(NHTRACE_LOG) && !_s_debugfp) {
/* truncate trace file */ /* truncate trace file */
_s_debugfp = fopen(NHTRACE_LOG, "w"); _s_debugfp = fopen(NHTRACE_LOG, "w");
} }
# endif
#endif #endif
logDebug("mswin_init_nhwindows()\n"); logDebug("mswin_init_nhwindows()\n");
@@ -2192,7 +2196,8 @@ mswin_popup_destroy(HWND hWnd)
SetFocus(GetNHApp()->hMainWnd); SetFocus(GetNHApp()->hMainWnd);
} }
#ifdef _DEBUG #ifdef DEBUG
# ifdef _DEBUG
#include <stdarg.h> #include <stdarg.h>
void void
@@ -2208,7 +2213,7 @@ logDebug(const char *fmt, ...)
va_end(args); va_end(args);
fflush(_s_debugfp); fflush(_s_debugfp);
} }
# endif
#endif #endif
/* Reading and writing settings from the registry. */ /* Reading and writing settings from the registry. */