From: Vincent Bernat Date: Sat, 22 Dec 2012 22:30:22 +0000 (+0100) Subject: build: ensure _GNU_SOURCE is defined early X-Git-Tag: 0.7.0~50 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d6aba3e3a87fe03d48ea369937edb29d15ee06e;p=thirdparty%2Flldpd.git build: ensure _GNU_SOURCE is defined early It is needed to use some extensions like `strnlen()`. --- diff --git a/src/daemon/agent.c b/src/daemon/agent.c index c33fea5e..19212924 100644 --- a/src/daemon/agent.c +++ b/src/daemon/agent.c @@ -15,9 +15,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include "lldpd.h" + #include -#include "lldpd.h" #include "agent.h" #include "frame.h" diff --git a/src/daemon/lldpd.h b/src/daemon/lldpd.h index 95653ca9..ccbee06b 100644 --- a/src/daemon/lldpd.h +++ b/src/daemon/lldpd.h @@ -17,6 +17,7 @@ #ifndef _LLDPD_H #define _LLDPD_H +#define _GNU_SOURCE 1 #if HAVE_CONFIG_H # include @@ -28,7 +29,6 @@ # define RUNNING_ON_VALGRIND 0 #endif -#define _GNU_SOURCE 1 #include #include #include diff --git a/src/marshal.c b/src/marshal.c index f154af93..cde976a3 100644 --- a/src/marshal.c +++ b/src/marshal.c @@ -15,6 +15,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#define _GNU_SOURCE 1 #define MARSHAL_EXPORT #include "marshal.h"