summaryrefslogtreecommitdiff
path: root/gps.h
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2019-03-13 19:37:33 -0700
committerFred Wright <fw@fwright.net>2019-03-18 19:41:03 -0700
commit7722705676a8c7d52c612057de241167459b9e33 (patch)
tree296d3571ee331788cb48ad9c30da53f49c296169 /gps.h
parent68d54c2dac8e2d082f0326cdcf56c31e70203300 (diff)
downloadgpsd-7722705676a8c7d52c612057de241167459b9e33.tar.gz
Avoids troublesome dependency on M_LN2 from math.h.
The M_LN2 definition isn't always provided by math.h, depending on the settings of the pesky configure flags. Since ln(2) is a mathematical constant, there's no loss of generality in defining our own version, and that decouples us from the variability. Since the stated purpose of defining _XOPEN_SOURCE in driver_tsip.c and driver_zodiac.c is just to make M_LN2 available, this is no longer necessary. TESTED: (With subsequent fixes included) Ran "build-all check" on Mac Pro 10.9, Mac Pro 10.14, MacBook Pro 10.9, PowerBook 10.5, VMs for OSX 10.5-10.13, Ubuntu 14.04, CentOS 7, Fedora 25, FreeBSD 10.3, OpenBSD 5.6, OpenBSD 5.6 32-bit, NetBSD 6.1.5, and Beaglebone (arm) Debian 7.
Diffstat (limited to 'gps.h')
-rw-r--r--gps.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gps.h b/gps.h
index 35404615..23a97594 100644
--- a/gps.h
+++ b/gps.h
@@ -2240,6 +2240,10 @@ extern double wgs84_separation(double, double);
#define RAD_2_DEG 57.2957795130823208767981548141051703
#define DEG_2_RAD 0.0174532925199432957692369076848861271
+/* other mathematical constants */
+#define GPS_LN2 0.693147180559945309417232121458176568
+
+
/* geodetic constants */
#define WGS84A 6378137 /* equatorial radius */
#define WGS84F 298.257223563 /* flattening */