From 7277fda2fa7670c96998f4bf3d05ec60b5452f3c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20R=C3=B6nnquist?= Date: Tue, 7 Dec 2021 01:58:44 +0100 Subject: [PATCH] Fix building whereami on Hurd --- src/whereami.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) { -- 2.20.1