summaryrefslogtreecommitdiff
path: root/gpsd.h
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2005-07-20 16:48:30 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2005-07-20 16:48:30 +0000
commitc367d791d936617e43c93e3379900d3fc65c4d89 (patch)
tree977bf522b4e5651dafd4005468cbc4763147065c /gpsd.h
parent8cf81bb9b864c51b8bcb7e10a18e762ec4e81773 (diff)
downloadgpsd-c367d791d936617e43c93e3379900d3fc65c4d89.tar.gz
This defines NAN for us where needed.
There is talk of Bad Stuff happening when NAN is just a global ifndef/define/endif, so we wrap it in tests for OSes where we know we don't have NAN.
Diffstat (limited to 'gpsd.h')
-rw-r--r--gpsd.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gpsd.h b/gpsd.h
index 1ee735dd..9e6504c0 100644
--- a/gpsd.h
+++ b/gpsd.h
@@ -296,4 +296,12 @@ extern float roundf(float x);
#define roundf(x) ((float)rintf(x))
#endif /* !HAVE_ROUND */
+/* OpenBSD and FreeBSD don't seem to have NAN, NetBSD does, others? */
+/* XXX test for this in configure? */
+#if defined(__OpenBSD__) || defined(__FreeBSD__)
+#ifndef NAN
+#define NAN (0.0/0.0)
+#endif /* !NAN */
+#endif /* list of Operating Systems */
+
#endif /* _gpsd_h_ */