diff options
author | Gary E. Miller <gem@rellim.com> | 2016-09-07 03:13:03 +0100 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2016-09-07 03:13:03 +0100 |
commit | cb216cd0ad6f6f0cc51596ead6720082386c84c9 (patch) | |
tree | 7ab4796ea00f125c9f8525e70acaed333aa1b53c | |
parent | 5269af1e7b46e5cfa6b17ccf9a40aa1efd0a6cc6 (diff) | |
download | gpsd-cb216cd0ad6f6f0cc51596ead6720082386c84c9.tar.gz |
Shield FreeBSD from standards compliance.
gpsd now compiles, and runs scons check, with no warnings on
FreeBSD.
-rw-r--r-- | driver_ais.c | 4 | ||||
-rw-r--r-- | driver_tsip.c | 4 | ||||
-rw-r--r-- | driver_zodiac.c | 5 | ||||
-rw-r--r-- | gpsctl.c | 7 | ||||
-rw-r--r-- | gpsd_json.c | 7 | ||||
-rw-r--r-- | libgpsd_core.c | 4 |
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> @@ -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 |