From: cohrs Date: Sun, 2 Mar 2003 06:07:19 +0000 (+0000) Subject: U277 - Gnome compilation on Redhat 7.2 & 8.0 X-Git-Tag: MOVE2GIT~2124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6da412ef12cf412eec737bac5d83a5a5a3d6dcc;p=nethack U277 - Gnome compilation on Redhat 7.2 & 8.0 Reported on RH 7.2 and 8.0. Compilation failed because system headers that needed _GNU_SOURCE on these Redhat versions got included before it was defined. To ensure _GNU_SOURCE is defined, added an autodetect for it to config1.h and removed the need to set it in unixres.c. __linux__ is also checked elsewhere. --- diff --git a/doc/fixes34.2 b/doc/fixes34.2 index bea639d3e..0e233ae19 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -7,6 +7,7 @@ avoid panic when secondary weapon is cursed while generating bones level Platform- and/or Interface-Specific Fixes ----------------------------------------- +Gnome: compilation problems on Redhat 7.2 and 8.0 General New Features @@ -16,5 +17,4 @@ General New Features Platform- and/or Interface-Specific New Features ------------------------------------------------ - diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 15f244766..58d693e90 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -8,6 +8,7 @@ avoid panic when secondary weapon is cursed while generating bones level Platform- and/or Interface-Specific Fixes ----------------------------------------- +Gnome: compilation problems on Redhat 7.2 and 8.0 General New Features diff --git a/include/config1.h b/include/config1.h index 6c6d7af77..d17225f6a 100644 --- a/include/config1.h +++ b/include/config1.h @@ -130,6 +130,11 @@ #endif +#if defined(__linux__) && defined(__GNUC__) && !defined(_GNU_SOURCE) +/* ensure _GNU_SOURCE is defined before including any system headers */ +# define _GNU_SOURCE +#endif + #ifdef VMS /* really old compilers need special handling, detected here */ # undef UNIX # ifdef __DECC diff --git a/sys/unix/unixres.c b/sys/unix/unixres.c index bf352ba62..8c234e573 100644 --- a/sys/unix/unixres.c +++ b/sys/unix/unixres.c @@ -19,9 +19,6 @@ #ifdef GETRES_SUPPORT # if defined(LINUX) -#ifdef __GNUC__ -#define _GNU_SOURCE -#endif /* requires dynamic linking with libc */ #include