summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver_ais.c4
-rw-r--r--driver_tsip.c4
-rw-r--r--driver_zodiac.c5
-rw-r--r--gpsctl.c7
-rw-r--r--gpsd_json.c7
-rw-r--r--libgpsd_core.c4
6 files changed, 25 insertions, 6 deletions
diff --git a/driver_ais.c b/driver_ais.c
index f7c5a790..5f48c595 100644
--- a/driver_ais.c
+++ b/driver_ais.c
@@ -16,8 +16,12 @@
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
+#ifdef __linux__
+/* FreeBSD chokes on this */
/* isascii() needs _XOPEN_SOURCE, 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
+#endif /* __linux__ */
+
/* strlcpy() needs _DARWIN_C_SOURCE */
#define _DARWIN_C_SOURCE
diff --git a/driver_tsip.c b/driver_tsip.c
index 34a53e83..4fd364c6 100644
--- a/driver_tsip.c
+++ b/driver_tsip.c
@@ -13,11 +13,15 @@
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
+#ifdef __linux__
+/* FreeBSD chokes on this */
/* if we insist on C99, then we need this to get M_LN2 from math.h */
/* 500 mean X/Open 1995 */
#define _XOPEN_SOURCE 500
/* round() needs _POSIX_C_SOURCE >= 200112L */
#define _POSIX_C_SOURCE 200112L
+#endif /* __linux__ */
+
#include <sys/time.h> /* for select() */
#include <string.h>
diff --git a/driver_zodiac.c b/driver_zodiac.c
index e1ce407e..11a53ed8 100644
--- a/driver_zodiac.c
+++ b/driver_zodiac.c
@@ -10,11 +10,16 @@
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
+#ifdef __linux__
+/* FreeBSD chokes on this */
+/* if we insist on C99, then we need this to get M_LN2 from math.h */
/* if we insisnt on C99, then we need this to get M_LN2 from math.h */
/* 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
/* round() needs _POSIX_C_SOURCE >= 200112L */
#define _POSIX_C_SOURCE 200112L
+#endif /* __linux__ */
+
#include <stdio.h>
#include <stdbool.h>
diff --git a/gpsctl.c b/gpsctl.c
index 6f392f97..d0b75401 100644
--- a/gpsctl.c
+++ b/gpsctl.c
@@ -5,16 +5,17 @@
*
*/
+#ifdef __linux__
+/* FreeBSD chokes on this */
/* sys/ipc.h needs _XOPEN_SOURCE, 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
/* pselect() needs _POSIX_C_SOURCE >= 200112L */
#define _POSIX_C_SOURCE 200112L
+#endif /* __linux__ */
+
/* strlcpy() needs _DARWIN_C_SOURCE */
#define _DARWIN_C_SOURCE
-/* for vsnprintf() FreeBSD wants __ISO_C_VISIBLE >= 1999 */
-#define __ISO_C_VISIBLE 1999
-
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
diff --git a/gpsd_json.c b/gpsd_json.c
index b7105de0..825851e3 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -14,16 +14,17 @@ PERMISSIONS
***************************************************************************/
+#ifdef __linux__
+/* FreeBSD chokes on this */
/* isascii() needs _XOPEN_SOURCE, 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
+#endif /* __linux__ */
+
/* vsnprintf() needs __DARWIN_C_LEVEL >= 200112L */
#define __DARWIN_C_LEVEL 200112L
/* strlcpy() needs _DARWIN_C_SOURCE */
#define _DARWIN_C_SOURCE
-/* for vsnprintf() FreeBSD wants __ISO_C_VISIBLE >= 1999 */
-#define __ISO_C_VISIBLE 1999
-
#include <stdio.h>
#include <math.h>
#include <assert.h>
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 302b9cc8..62631424 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -10,10 +10,14 @@
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
+#ifdef __linux__
+/* FreeBSD chokes on this */
/* getsid() needs _XOPEN_SOURCE, 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
/* isfinite() and pselect() needs _POSIX_C_SOURCE >= 200112L */
#define _POSIX_C_SOURCE 200112L
+#endif /* __linux__ */
+
/* strlcpy() needs _DARWIN_C_SOURCE */
#define _DARWIN_C_SOURCE