summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.in1
-rw-r--r--src/helper/jim.c3
-rw-r--r--src/target/oocd_trace.c5
3 files changed, 1 insertions, 8 deletions
diff --git a/configure.in b/configure.in
index 4243e668..875212e2 100644
--- a/configure.in
+++ b/configure.in
@@ -851,6 +851,7 @@ if test "${has_environ}" != "yes" ; then
AC_MSG_FAILURE([Could not find 'environ' in unistd.h or available libraries.])
fi
+AC_DEFINE([_GNU_SOURCE],[1],[Use GNU C library extensions (e.g. stdndup).])
# set default gcc warnings
GCC_WARNINGS="-Wall -Wstrict-prototypes -Wformat-security"
diff --git a/src/helper/jim.c b/src/helper/jim.c
index 9d49e871..5122615d 100644
--- a/src/helper/jim.c
+++ b/src/helper/jim.c
@@ -53,9 +53,6 @@
#define JIM_DYNLIB /* Dynamic library support for UNIX and WIN32 */
#endif /* JIM_ANSIC */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE /* for vasprintf() */
-#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/target/oocd_trace.c b/src/target/oocd_trace.c
index dc96d13f..d54766ae 100644
--- a/src/target/oocd_trace.c
+++ b/src/target/oocd_trace.c
@@ -21,11 +21,6 @@
#include "config.h"
#endif
-// we must define _GNU_SOURCE to get strndup
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
#include "oocd_trace.h"
#include "arm7_9_common.h"