From f307f05afdb75ce745fec9c1eaf0d63ec73e3c09 Mon Sep 17 00:00:00 2001 From: PatR Date: Thu, 17 Apr 2025 10:10:52 -0700 Subject: [PATCH] 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.) --- include/tradstdc.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/include/tradstdc.h b/include/tradstdc.h index f2ebeb74e..adcfa0619 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -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