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:
PatR
2025-04-17 10:10:52 -07:00
parent f1ba320cb3
commit f307f05afd

View File

@@ -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) Robert Patrick Rankin, 2006. */
/* NetHack may be freely redistributed. See license for details. */
@@ -178,14 +178,10 @@ typedef const char *vA;
typedef genericptr genericptr_t; /* (void *) or (char *) */
#endif
#if defined(MICRO) || defined(WIN32)
#ifndef NO_PTR_FMT
/* We actually want to know which systems have an ANSI run-time library
* to know which support the %p format for printing pointers.
* Due to the presence of things like gcc, NHSTDC is not a good test.
* 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).
*/
* Since we require C99 or later, assume the library supports it. */
#define HAS_PTR_FMT
#endif