From: Andreas Rönnquist Date: Tue, 7 Dec 2021 00:58:44 +0000 (+0100) Subject: Fix building whereami on Hurd X-Git-Tag: v1.7~19 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=7277fda2fa7670c96998f4bf3d05ec60b5452f3c Fix building whereami on Hurd --- diff --git a/src/whereami.c b/src/whereami.c index b94ce262..fe12eba1 100644 --- a/src/whereami.c +++ b/src/whereami.c @@ -3,6 +3,10 @@ // by Gregory Pakosz (@gpakosz) // https://github.com/gpakosz/whereami +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif + // in case you want to #include "whereami.c" in a larger compilation unit #if !defined(WHEREAMI_H) #include @@ -160,7 +164,7 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) return length; } -#elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(WAI_USE_PROC_SELF_EXE) +#elif defined(__linux__) || defined(__CYGWIN__) || defined(__sun) || defined(__GNU__) || defined(WAI_USE_PROC_SELF_EXE) #include #include @@ -183,6 +187,10 @@ int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length) #endif #endif +#ifndef PATH_MAX +#define PATH_MAX 4096 +#endif + WAI_FUNCSPEC int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length) {