aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nnn.c b/src/nnn.c
index ca9fef6..a8f82ed 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -90,9 +90,6 @@
#include <signal.h>
#include <stdarg.h>
#include <stdlib.h>
-#ifdef __sun
-#include <alloca.h>
-#endif
#include <string.h>
#include <strings.h>
#include <time.h>
@@ -103,6 +100,15 @@
#include <ftw.h>
#include <wchar.h>
+#if !defined(alloca) && defined(__GNUC__)
+/*
+ * GCC doesn't expand alloca() to __builtin_alloca() in standards mode
+ * (-std=...) and not all standard libraries do or supply it, e.g.
+ * NetBSD/arm64 so explicitly use the builtin.
+ */
+#define alloca(size) __builtin_alloca(size)
+#endif
+
#include "nnn.h"
#include "dbg.h"