another MONITOR_HEAP
'unsigned long' isn't big enough to hold a pointer in my configuration, and the old "only micros are sure to support %p format" is long out of date. Just assume that everyone has %p these days, and provide a hook to avoid it for anyone who doesn't. (Opt-out instead of opt-in.)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 tradstdc.h $NHDT-Date: 1685522034 2023/05/31 08:33:54 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.54 $ */
|
/* NetHack 3.7 tradstdc.h $NHDT-Date: 1744938651 2025/04/17 17:10:51 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.67 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2006. */
|
/*-Copyright (c) Robert Patrick Rankin, 2006. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -178,14 +178,10 @@ typedef const char *vA;
|
|||||||
typedef genericptr genericptr_t; /* (void *) or (char *) */
|
typedef genericptr genericptr_t; /* (void *) or (char *) */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(MICRO) || defined(WIN32)
|
#ifndef NO_PTR_FMT
|
||||||
/* We actually want to know which systems have an ANSI run-time library
|
/* We actually want to know which systems have an ANSI run-time library
|
||||||
* to know which support the %p format for printing pointers.
|
* to know which support the %p format for printing pointers.
|
||||||
* Due to the presence of things like gcc, NHSTDC is not a good test.
|
* Since we require C99 or later, assume the library supports it. */
|
||||||
* So we assume microcomputers have all converted to ANSI and bigger
|
|
||||||
* computers which may have older libraries give reasonable results with
|
|
||||||
* casting pointers to unsigned long int (fmt_ptr() in alloc.c).
|
|
||||||
*/
|
|
||||||
#define HAS_PTR_FMT
|
#define HAS_PTR_FMT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user