]> granicus.if.org Git - nethack/commitdiff
fix missing prototype warning for Qt SELECTSAVED
authornhmall <nhmall@nethack.org>
Sat, 23 Jan 2021 14:37:47 +0000 (09:37 -0500)
committernhmall <nhmall@nethack.org>
Sat, 23 Jan 2021 14:37:47 +0000 (09:37 -0500)
For whatever reason, Qt relies on late #define of SELECTSAVED
inside files.c.

The prototype in extern.h is therefore not picked up with
as a result of #include "hack.h"

Options were:
1. remove the conditional #if defined(SELECTSAVED) around the
   prototype in extern.h entirely
2. Move the forced #define of SELECTSAVED above the #include "hack.h"
3. Alter the conditional in extern.h to also include the condition for
   the forced #define of SELECTSAVED inside files.c

This goes with option #3.

include/extern.h

index 8df78d7207d4c740412d84c3d3c052066b263e2c..931d5b792394da74cf79899f1ae14b253a571090 100644 (file)
@@ -804,7 +804,7 @@ E int FDECL(parse_sym_line, (char *, int));
 E void FDECL(paniclog, (const char *, const char *));
 E void FDECL(testinglog, (const char *, const char *, const char *));
 E int FDECL(validate_prefix_locations, (char *));
-#ifdef SELECTSAVED
+#if defined(SELECTSAVED) || (defined(UNIX) && defined(QT_GRAPHICS))
 E char *FDECL(plname_from_file, (const char *));
 #endif
 E char **NDECL(get_saved_games);