Kaynağa Gözat

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
Maxime Vincent 9 yıl önce
ebeveyn
işleme
48ba91275c
2 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 1 1
      Makefile
  2. 1 0
      minmea.c

+ 1 - 1
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

+ 1 - 0
minmea.c

@@ -12,6 +12,7 @@
 #include <string.h>
 #include <ctype.h>
 #include <stdarg.h>
+#include <time.h>
 
 #define boolstr(s) ((s) ? "true" : "false")