diff --git a/include/hack.h b/include/hack.h index b21fd98dc..c97aff6af 100644 --- a/include/hack.h +++ b/include/hack.h @@ -1512,17 +1512,16 @@ typedef uint32_t mmflags_nht; /* makemon MM_ flags */ #define getlogin() ((char *) 0) #endif /* MICRO */ -/* The function argument to qsort() requires a particular - * calling convention under WINCE which is not the default - * in that environment. - */ -#if defined(WIN_CE) -#define QSORTCALLBACK __cdecl -#else +/* These may have been defined to platform-specific values in *conf.h + * or on the compiler command line from a hints file or Makefile */ + +#ifndef QSORTCALLBACK #define QSORTCALLBACK #endif +#ifndef SIG_RET_TYPE #define SIG_RET_TYPE void (*)(int) +#endif #define DEVTEAM_EMAIL "devteam@nethack.org" #define DEVTEAM_URL "https://www.nethack.org/" diff --git a/include/windconf.h b/include/windconf.h index c3b6d4e05..bd30f8a6b 100644 --- a/include/windconf.h +++ b/include/windconf.h @@ -274,6 +274,10 @@ extern boolean file_newer(const char *, const char *); /* #include "system.h" */ #endif +#if defined(WIN_CE) +#define QSORTCALLBACK __cdecl +#endif + /* Override the default version of nhassert. The default version is unable * to generate a string form of the expression due to the need to be * compatible with compilers which do not support macro stringization (i.e. diff --git a/sys/unix/hints/linux.370 b/sys/unix/hints/linux.370 index e3dec785b..1644cc826 100755 --- a/sys/unix/hints/linux.370 +++ b/sys/unix/hints/linux.370 @@ -165,17 +165,28 @@ endif #WANT_WIN_CURSES #-INCLUDE multisnd1-pre.370 # +ifeq "$(CCISCLANG)" "1" +# clang-specific starts +# clang-specific ends +else +# gcc-specific starts +LIBCFLAGS+=-DSIG_RET_TYPE=__sighandler_t +# gcc-specific ends +endif + # WINCFLAGS set from multiw-2.370 # SNDCFLAGS set from multisnd-pre.370 CFLAGS+= $(WINCFLAGS) CFLAGS+= $(SNDCFLAGS) CFLAGS+= $(NHCFLAGS) +CFLAGS+= $(LIBCFLAGS) # WINCFLAGS set from multiw-2.370 # SNDCFLAGS set from multisnd-pre.370 CCXXFLAGS+= $(WINCFLAGS) CCXXFLAGS+= $(SNDCFLAGS) CCXXFLAGS+= $(NHCFLAGS) +CCXXFLAGS+= $(LIBCFLAGS) VARDATND = VARDATND0 = diff --git a/sys/unix/hints/macOS.370 b/sys/unix/hints/macOS.370 index 05042cafd..48b9e90df 100755 --- a/sys/unix/hints/macOS.370 +++ b/sys/unix/hints/macOS.370 @@ -219,17 +219,30 @@ endif #-INCLUDE multisnd1-pre.370 # +# although not currently doing anything for macOS, this is +# kept in for consistency with layout of linux.370 +ifeq "$(CCISCLANG)" "1" +# clang-specific starts +# clang-specific ends +else +# gcc-specific starts +# LIBCFLAGS+= +# gcc-specific ends +endif + # WINCFLAGS set from multiw-2.370 # SNDCFLAGS set from multisnd-pre.370 CFLAGS+= $(PKGCFLAGS) $(WINCFLAGS) CFLAGS+= $(SNDCFLAGS) CFLAGS+= $(NHCFLAGS) +CFLAGS+= $(LIBCFLAGS) # WINCFLAGS set from multiw-2.370 # SNDCFLAGS set from multisnd-pre.370 CCXXFLAGS+= $(WINCFLAGS) CCXXFLAGS+= $(SNDCFLAGS) CCXXFLAGS+= $(NHCFLAGS) +CCXXFLAGS+= $(LIBCFLAGS) VARDATND = VARDATND0 =