avoid some issues with c++ and X11

This commit is contained in:
nhmall
2023-02-01 10:41:04 -05:00
parent 79d8f95f57
commit d4a111083a
6 changed files with 12 additions and 0 deletions

View File

@@ -465,6 +465,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
* function will cause a link failure on non-Unix platforms,
* so it is preferrable to catch it early, during compile.
*/
#if !defined(X11_BUILD) && !defined(__cplusplus)
#if defined(__GNUC__) && !defined(__CLANG__)
#if __GNUC__ >= 12
extern char *index(const char *s, int c) __attribute__ ((unavailable));
@@ -477,6 +478,7 @@ extern char *index(const char *s, int c) __attribute__ ((unavailable));
extern char *rindex(const char *s, int c) __attribute__ ((unavailable));
#endif
#endif
#endif
#endif /* TRADSTDC_H */

View File

@@ -77,7 +77,9 @@
#undef PRESERVE_NO_SYSV
#endif
#define X11_BUILD
#include "config.h" /* #define for const for non __STDC__ compilers */
#undef X11_BUILD
#include "lint.h" /* for nethack's nhStr() macro */
#include "winX.h" /* to make sure protoypes match corresponding functions */

View File

@@ -16,6 +16,8 @@
#define SHORT_FILENAMES
#endif
#define X11_BUILD
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <X11/Shell.h>

View File

@@ -33,6 +33,8 @@
#undef PRESERVE_NO_SYSV
#endif
#define X11_BUILD
#include "hack.h"
#include "winX.h"

View File

@@ -34,6 +34,8 @@
#undef PRESERVE_NO_SYSV
#endif
#define X11_BUILD
#include "hack.h"
#include "func_tab.h"
#include "winX.h"

View File

@@ -28,6 +28,8 @@
#undef PRESERVE_NO_SYSV
#endif
#define X11_BUILD
#include "hack.h"
#include "winX.h"
#include "xwindow.h"