summaryrefslogtreecommitdiff
path: root/gpsutils.c
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2019-03-27 18:14:39 -0700
committerFred Wright <fw@fwright.net>2019-03-27 19:12:42 -0700
commit6b1d7f41bd97b343701f6a6c4d230101fc2a684c (patch)
treeff1fcea2ea185a81d303ba2cbcb1e36cd1ee211d /gpsutils.c
parent32459eb0c8ed66a87cf4d0a40dfd61f1aa316287 (diff)
downloadgpsd-6b1d7f41bd97b343701f6a6c4d230101fc2a684c.tar.gz
gpsutils: Fixes build on OSX.
OSX needs _DARWIN_C_SOURCE defined to get strlcpy() (copied from driver_ais.c). There's some inconsistency in the config test, perhaps related to its being a builtin. TESTED: Ran "build-all check" on most of the usual set of machines and VMs, with no issues. Only skipped macOS 10.14, due to the large cost of rebooting into it at this time.
Diffstat (limited to 'gpsutils.c')
-rw-r--r--gpsutils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gpsutils.c b/gpsutils.c
index 988e4fb7..49a6959d 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -15,6 +15,9 @@
#define _POSIX_C_SOURCE 200112L
#endif
+/* strlcpy() needs _DARWIN_C_SOURCE */
+#define _DARWIN_C_SOURCE
+
#include <ctype.h>
#include <errno.h>
#include <math.h>