From 48ba91275c57838150979eb2820b6e10f5a894b2 Mon Sep 17 00:00:00 2001 From: Maxime Vincent Date: Sat, 23 Apr 2016 21:55:03 +0200 Subject: [PATCH] Use _DEFAULT_SOURCE instead of _BSD_SOURCE (support newer compilers) * Use _DEFAULT_SOURCE instead of _BSD_SOURCE * Include header for gmtime/mktime * Keep glibc < 2.20 and >= 2.20 happy --- Makefile | 2 +- minmea.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b82900a..1516c81 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ # published by Sam Hocevar. See the COPYING file for more details. CFLAGS = -g -Wall -Wextra -Werror -std=c99 -CFLAGS += -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -D_DARWIN_C_SOURCE +CFLAGS += -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_DARWIN_C_SOURCE LDLIBS = -lcheck all: scan-build test example diff --git a/minmea.c b/minmea.c index 5566d95..e5633c6 100644 --- a/minmea.c +++ b/minmea.c @@ -12,6 +12,7 @@ #include #include #include +#include #define boolstr(s) ((s) ? "true" : "false")