summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpsd.c8
-rw-r--r--timehint.c3
2 files changed, 6 insertions, 5 deletions
diff --git a/gpsd.c b/gpsd.c
index 8fa0b0eb..2e94813c 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -6,6 +6,8 @@
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
+#ifdef __linux__
+/* FreeBSD chokes on this */
/* nice() needs _XOPEN_SOURCE, 500 means X/Open 1995 */
#define _XOPEN_SOURCE 500
/* setgroups() and daemon() needs _DEFAULT_SOURCE */
@@ -14,11 +16,7 @@
#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
-/* for INADDR_LOOPBACK() FreeBSD wants __BSD_VISIBLE */
-#define __BSD_VISIBLE
+#endif /* __linux__ */
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/timehint.c b/timehint.c
index c8b4bb84..af1fc700 100644
--- a/timehint.c
+++ b/timehint.c
@@ -8,12 +8,15 @@
* see the file COPYING in the distribution root for details.
*/
+#ifdef __linux__
+/* FreeBSD chokes on this */
/* 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
+#endif /* __linux__ */
#include <string.h>
#include <libgen.h>