Apply paxed's DEBUG patch to remove DEBUG/D_DEBUG.
Move debugging output into couple preprocessor defines, which
are no-op without DEBUG. To show debugging output from a
certain source files, use sysconf:
DEBUGFILES=dungeon.c questpgr.c
Also fix couple debug lines which did not compile.
This also includes fixes due to Derek Ray to depugpline to work better
on other platforms.
This commit is contained in:
@@ -11,9 +11,31 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
/* For debugging beta code. */
|
||||
#ifdef BETA
|
||||
#define Dpline pline
|
||||
#ifdef DEBUG
|
||||
/* due to strstr(), mon.c matches makemon.c */
|
||||
# define showdebug() (sysopt.debugfiles && \
|
||||
((sysopt.debugfiles[0] == '*') || \
|
||||
(strstr( __FILE__ , sysopt.debugfiles))))
|
||||
|
||||
/* GCC understands this syntax */
|
||||
# ifdef __GNUC__
|
||||
/* ... but whines about it anyway without these pragmas. */
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wvariadic-macros"
|
||||
# define debugpline(args...) \
|
||||
do { if (showdebug()) pline( args ); } while(0);
|
||||
# pragma GCC diagnostic pop
|
||||
# endif
|
||||
|
||||
/* and Visual Studio understands this one */
|
||||
# ifdef _MSC_VER
|
||||
# define debugpline(...) \
|
||||
do { if (showdebug()) pline(__VA_ARGS__); } while(0);
|
||||
# endif
|
||||
|
||||
#else
|
||||
# define showdebug() (0)
|
||||
# define debugpline(...)
|
||||
#endif
|
||||
|
||||
#define TELL 1
|
||||
|
||||
Reference in New Issue
Block a user