summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wong <mark@2ndQuadrant.com>2020-08-05 11:02:36 -0700
committerMark Wong <markwkm@gmail.com>2020-08-05 13:09:04 -0700
commit10d34eadda4f46ef64fc37f620ea1bc903a5b8b8 (patch)
tree72f559715f041af35ef92a0c41773c18e34b9406
parent65ad4e07592d4fbded1d8ffbc8e7c2c273d0e329 (diff)
linux: define _GNU_SOURCE for reallocarray()
Some Linux distros may need _GNU_SOURCE explicitly defined in order to use reallocarray() in. Ubuntu 18.01 is one of them.
-rw-r--r--machine/m_linux.c2
-rw-r--r--machine/m_remote.c4
2 files changed, 6 insertions, 0 deletions
diff --git a/machine/m_linux.c b/machine/m_linux.c
index 1aa96c1..f643e31 100644
--- a/machine/m_linux.c
+++ b/machine/m_linux.c
@@ -17,6 +17,8 @@
* Ported to 2.4 by William LeFebvre
*/
+#define _GNU_SOURCE
+
#include "config.h"
#include <sys/types.h>
diff --git a/machine/m_remote.c b/machine/m_remote.c
index 19b2ddd..187737c 100644
--- a/machine/m_remote.c
+++ b/machine/m_remote.c
@@ -2,6 +2,10 @@
* Copyright (c) 2008-2009, Mark Wong
*/
+#ifdef __linux__
+#define _GNU_SOURCE
+#endif /* __linux__ */
+
#include <stdlib.h>
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#include <sys/tree.h>