Package: crawl Version: 2:0.5.2-3 Severity: important Tags: patch User: debian-h...@lists.debian.org Usertags: hurd
Hi, as shown in the log[1], crawl fails to build on GNU/Hurd. This is because the code checks for the macro "__MACH__" to know whether the current OS is mac OS X, but this macro really checks for the Mach kernel, which is (almost) the same used currently on GNU/Hurd. The attached patch fixes the issue using a really OSX-specific compiler macro ("__APPLE__", basically). [1] https://buildd.debian.org/fetch.cgi?pkg=crawl&arch=hurd-i386&ver=2:0.5.2-3&stamp=1259407285&file=log&as=raw Thanks, -- Pino
Fix OSX detection, so Hurd (which has a Mach kernel) is not misrecognized for it. --- a/source/AppHdr.h +++ b/source/AppHdr.h @@ -24,7 +24,7 @@ // Very simple OS detection, done via predefined macros // For a list of predefined macros, see // http://predef.sourceforge.net/ -#if defined(__MACH__) +#if defined(__APPLE__) #ifndef OSX #define OSX #endif --- a/source/initfile.cc +++ b/source/initfile.cc @@ -17,7 +17,7 @@ #include <windows.h> #elif defined ( __linux__ ) #include <unistd.h> -#elif defined ( __MACH__ ) +#elif defined ( __APPLE__ ) extern char **NXArgv; #endif @@ -3459,7 +3459,7 @@ readlink("/proc/self/exe", tempPath, sizeof(tempPath) - 1); if (rsize > 0) tempPath[rsize] = 0; -#elif defined ( __MACH__ ) +#elif defined ( __APPLE__ ) strncpy ( tempPath, NXArgv[0], sizeof(tempPath) ); #else // We don't know how to find the executable's path on this OS.