Added nhassert to core.
This commit is contained in:
@@ -1932,6 +1932,7 @@ E void VDECL(verbalize, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void VDECL(config_error_add, (const char *, ...)) PRINTF_F(1, 2);
|
||||
E void FDECL(nhassert_failed, (const char *, const char *, int));
|
||||
|
||||
/* ### polyself.c ### */
|
||||
|
||||
|
||||
@@ -375,5 +375,10 @@ struct savefile_info {
|
||||
#define nethack_enter(argc, argv) ((void) 0)
|
||||
#endif
|
||||
|
||||
/* Supply nhassert macro if not supplied by port */
|
||||
#ifndef nhassert
|
||||
#define nhassert(expression) (void)((!!(expression)) || \
|
||||
(nhassert_failed(#expression, __FILE__, __LINE__), 0))
|
||||
#endif
|
||||
|
||||
#endif /* GLOBAL_H */
|
||||
|
||||
@@ -267,16 +267,6 @@ extern int FDECL(set_win32_option, (const char *, const char *));
|
||||
extern int FDECL(alternative_palette, (char *));
|
||||
#endif
|
||||
|
||||
#ifdef NDEBUG
|
||||
#define nhassert(expression) ((void)0)
|
||||
#else
|
||||
extern void FDECL(nhassert_failed, (const char * exp, const char * file,
|
||||
int line));
|
||||
|
||||
#define nhassert(expression) (void)((!!(expression)) || \
|
||||
(nhassert_failed(#expression, __FILE__, __LINE__), 0))
|
||||
#endif
|
||||
|
||||
#define nethack_enter(argc, argv) nethack_enter_winnt()
|
||||
extern void FDECL(nethack_exit, (int)) NORETURN;
|
||||
extern boolean FDECL(file_exists, (const char *));
|
||||
|
||||
Reference in New Issue
Block a user