From b2dee731139e5e9067975a66b2e27aea739ea68f Mon Sep 17 00:00:00 2001
From: yangfl <yangfl@users.noreply.github.com>
Date: Fri, 10 Apr 2020 00:08:40 +0800
Subject: [PATCH 1/2] added support for kFreeBSD and GNU Hurd

Ref: https://github.com/marcIhm/yabasic/pull/29
---
 src/whereami.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/whereami.c b/src/whereami.c
index d76c6e2..f5849a9 100644
--- a/src/whereami.c
+++ b/src/whereami.c
@@ -3,6 +3,8 @@
 //   by Gregory Pakosz (@gpakosz)
 // https://github.com/gpakosz/whereami
 
+#define _GNU_SOURCE
+
 // in case you want to #include "whereami.c" in a larger compilation unit
 #if !defined(WHEREAMI_H)
 #include <whereami.h>
@@ -160,7 +162,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 <stdio.h>
 #include <stdlib.h>
@@ -183,6 +185,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.27.0

