[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] build failure, again, due to endian.h issues
From: |
Greg Troxel |
Subject: |
[gpsd-dev] build failure, again, due to endian.h issues |
Date: |
Tue, 05 Nov 2013 20:06:06 -0500 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/23.4 (berkeley-unix) |
driver_rtcm2.h fails to build. The problem is the #ifdef BSD, and
NetBSD does not define BSD as a preprocessor symbol. The following
patch is obviously not great, but gets things working.
diff --git a/driver_rtcm2.c b/driver_rtcm2.c
index 5c8532e..f3b52bd 100644
--- a/driver_rtcm2.c
+++ b/driver_rtcm2.c
@@ -73,7 +73,7 @@ BSD terms apply: see the file COPYING in the distribution
root for details.
#ifdef __LITTLE_ENDIAN__
#undef WORDS_BIGENDIAN
#else
-#ifdef BSD
+#ifdef __NetBSD__
#include <sys/endian.h>
#else
#include <endian.h>
To fix this, I suggest adding a header test to scons that acts like
AC_CHECK_HEADERS(endian.h sys/endian.h)
in autoconf.
If that's not doable, I would suggest applying the following, at least
until we hear from solaris or something more exotic. (While linux is
popular, one ifdef gets all linux flavors, vs adding many ifdefs.)
diff --git a/driver_rtcm2.c b/driver_rtcm2.c
index 5c8532e..0f4ea46 100644
--- a/driver_rtcm2.c
+++ b/driver_rtcm2.c
@@ -73,10 +73,10 @@ BSD terms apply: see the file COPYING in the distribution
root for details.
#ifdef __LITTLE_ENDIAN__
#undef WORDS_BIGENDIAN
#else
-#ifdef BSD
-#include <sys/endian.h>
-#else
+#ifdef linux
#include <endian.h>
+#else
+#include <sys/endian.h>
#endif
#if __BYTE_ORDER == __BIG_ENDIAN
#define WORDS_BIGENDIAN 1
pgp7meabGnC_r.pgp
Description: PGP signature
- [gpsd-dev] build failure, again, due to endian.h issues,
Greg Troxel <=
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Eric S. Raymond, 2013/11/05
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Beat Bolli, 2013/11/06
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Greg Troxel, 2013/11/06
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Eric S. Raymond, 2013/11/06
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Greg Troxel, 2013/11/06
- [gpsd-dev] [PATCH] RTCM V2: use scons to determine the location of <endian.h>., Beat Bolli, 2013/11/08
- Re: [gpsd-dev] build failure, again, due to endian.h issues, Beat Bolli, 2013/11/06