summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2016-08-16 13:53:28 -0700
committerGary E. Miller <gem@rellim.com>2016-08-16 13:53:28 -0700
commit1b6571adbc12f856ffc96ab501df0352e7b3e04c (patch)
tree47c8c28f259b4fce76715d1f48089e7c9ae702c4
parentbbbc307cbe9b91918c81ce282f86b3d3c542bf9a (diff)
downloadgpsd-1b6571adbc12f856ffc96ab501df0352e7b3e04c.tar.gz
__DARWIN_C_LEVEL and _DARWIN_C_SOURCE to silence some warnings.
vsnprintf() and strlcmp() are happier now.
-rw-r--r--driver_ais.c2
-rw-r--r--gpsctl.c3
-rw-r--r--gpsd.c4
-rw-r--r--gpsd_json.c4
-rw-r--r--libgpsd_core.c3
-rw-r--r--timehint.c4
6 files changed, 20 insertions, 0 deletions
diff --git a/driver_ais.c b/driver_ais.c
index d8b984db..f7c5a790 100644
--- a/driver_ais.c
+++ b/driver_ais.c
@@ -18,6 +18,8 @@
/* isascii() needs _XOPEN_SOURCE, 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
+/* strlcpy() needs _DARWIN_C_SOURCE */
+#define _DARWIN_C_SOURCE
#include <stdlib.h>
#include <string.h>
diff --git a/gpsctl.c b/gpsctl.c
index ff1ea6b7..d7f59e56 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -9,6 +9,9 @@
#define _XOPEN_SOURCE 500
/* pselect() needs _POSIX_C_SOURCE >= 200112L */
#define _POSIX_C_SOURCE 200112L
+/* strlcpy() needs _DARWIN_C_SOURCE */
+#define _DARWIN_C_SOURCE
+
#include <stdio.h>
#include <stdlib.h>
diff --git a/gpsd.c b/gpsd.c
index f028a093..d1b404b5 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -10,6 +10,10 @@
#define _XOPEN_SOURCE 500
/* setgroups() and daemon() needs _DEFAULT_SOURCE */
#define _DEFAULT_SOURCE
+/* vsnprintf() needs __DARWIN_C_LEVEL >= 200112L */
+#define __DARWIN_C_LEVEL 200112L
+/* strlcpy() needs _DARWIN_C_SOURCE */
+#define _DARWIN_C_SOURCE
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/gpsd_json.c b/gpsd_json.c
index 822f26e4..5e10cd08 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -16,6 +16,10 @@ PERMISSIONS
/* isascii() needs _XOPEN_SOURCE, 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
+/* vsnprintf() needs __DARWIN_C_LEVEL >= 200112L */
+#define __DARWIN_C_LEVEL 200112L
+/* strlcpy() needs _DARWIN_C_SOURCE */
+#define _DARWIN_C_SOURCE
#include <stdio.h>
#include <math.h>
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 41405ba5..b11d3223 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -14,6 +14,9 @@
#define _XOPEN_SOURCE 500
/* isfinite() and pselect() needs _POSIX_C_SOURCE >= 200112L */
#define _POSIX_C_SOURCE 200112L
+/* strlcpy() needs _DARWIN_C_SOURCE */
+#define _DARWIN_C_SOURCE
+
#include <time.h>
#include <stdio.h>
diff --git a/timehint.c b/timehint.c
index 8bf200a5..ee6567a4 100644
--- a/timehint.c
+++ b/timehint.c
@@ -10,6 +10,10 @@
/* nice() needs _XOPEN_SOURCE, 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
+/* snprintf() needs __DARWIN_C_LEVEL >= 200112L */
+#define __DARWIN_C_LEVEL 200112L
+/* snprintf() needs _DARWIN_C_SOURCE */
+#define _DARWIN_C_SOURCE
#include <string.h>
#include <libgen.h>