Merge branch 'old-software-compatibility' of https://github.com/chasonr/NetHack into NetHack-3.7

This commit is contained in:
nhmall
2022-11-05 19:30:20 -04:00
5 changed files with 10 additions and 3 deletions
+6
View File
@@ -401,6 +401,9 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
#if (__GNUC__ >= 2) && !defined(USE_OLDARGS) #if (__GNUC__ >= 2) && !defined(USE_OLDARGS)
#define PRINTF_F(f, v) __attribute__((format(printf, f, v))) #define PRINTF_F(f, v) __attribute__((format(printf, f, v)))
#endif #endif
#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define PRINTF_F_PTR(f, v) PRINTF_F(f, v)
#endif
#if __GNUC__ >= 3 #if __GNUC__ >= 3
#define UNUSED __attribute__((unused)) #define UNUSED __attribute__((unused))
#define NORETURN __attribute__((noreturn)) #define NORETURN __attribute__((noreturn))
@@ -419,6 +422,9 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
#ifndef PRINTF_F #ifndef PRINTF_F
#define PRINTF_F(f, v) #define PRINTF_F(f, v)
#endif #endif
#ifndef PRINTF_F_PTR
#define PRINTF_F_PTR(f, v)
#endif
#ifndef UNUSED #ifndef UNUSED
#define UNUSED #define UNUSED
#endif #endif
+1 -1
View File
@@ -2107,7 +2107,7 @@ place_object(struct obj *otmp, coordxy x, coordxy y)
register struct obj *otmp2; register struct obj *otmp2;
if (!isok(x, y)) { /* validate location */ if (!isok(x, y)) { /* validate location */
void (*func)(const char *, ...) PRINTF_F(1, 2); void (*func)(const char *, ...) PRINTF_F_PTR(1, 2);
func = (x < 0 || y < 0 || x > COLNO - 1 || y > ROWNO - 1) ? panic func = (x < 0 || y < 0 || x > COLNO - 1 || y > ROWNO - 1) ? panic
: impossible; : impossible;
+1 -1
View File
@@ -413,7 +413,7 @@ invault(void)
otherwise the hero wouldn't be able to push one to follow the otherwise the hero wouldn't be able to push one to follow the
guard out of the vault because that guard would be in its way */ guard out of the vault because that guard would be in its way */
if ((otmp = sobj_at(BOULDER, guard->mx, guard->my)) != 0) { if ((otmp = sobj_at(BOULDER, guard->mx, guard->my)) != 0) {
void (*func)(const char *, ...) PRINTF_F(1, 2); void (*func)(const char *, ...) PRINTF_F_PTR(1, 2);
const char *bname = simpleonames(otmp); const char *bname = simpleonames(otmp);
int bcnt = 0; int bcnt = 0;
+1 -1
View File
@@ -321,7 +321,7 @@ NetHack*map*orange: orange
NetHack*map*bright_green: green NetHack*map*bright_green: green
NetHack*map*yellow: yellow NetHack*map*yellow: yellow
NetHack*map*bright_blue: Royal blue NetHack*map*bright_blue: Royal blue
NetHack*map*bright_magenta: Fuchsia NetHack*map*bright_magenta: magenta
NetHack*map*bright_cyan: cyan NetHack*map*bright_cyan: cyan
NetHack*map*white: white NetHack*map*white: white
! !
+1
View File
@@ -12,6 +12,7 @@
#define PRESERVE_NO_SYSV /* X11 include files may define SYSV */ #define PRESERVE_NO_SYSV /* X11 include files may define SYSV */
#endif #endif
#include <X11/Xlib.h>
#include <X11/Xresource.h> #include <X11/Xresource.h>
#include <X11/Intrinsic.h> #include <X11/Intrinsic.h>
#include <X11/StringDefs.h> #include <X11/StringDefs.h>