gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH 7/8] Shift INTERNAL_SET definitions


From: Rob Norris
Subject: [gpsd-dev] [PATCH 7/8] Shift INTERNAL_SET definitions
Date: Tue, 19 Apr 2016 21:01:44 +0100

This makes the files libgps_json.c, rtcm2_json.c, rtcm3_json.c and gps_mask.c 
independent of gpsd.h
And now libgps is fully independent of gpsd.h and so can be built for Windows.

TESTED:
'scons build-all check' passes.
libgps.dll can be created under cross compiler for Windows. (Albeit with some 
manual SConstruct amendments to force DLL generation).
A test_libgps.exe can be created under cross compiler for Windows. (Albeit with 
some manual SConstruct amendments to add extra DLL dependencies).
test_libgps.exe connects to running gpsd instance.
---
 SConstruct    | 14 ++++++++++++++
 gpsd.h-tail   | 14 --------------
 libgps_json.c |  2 +-
 maskaudit.py  |  3 ++-
 rtcm2_json.c  |  2 +-
 rtcm3_json.c  |  2 +-
 6 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/SConstruct b/SConstruct
index a850c35..50614e2 100644
--- a/SConstruct
+++ b/SConstruct
@@ -851,6 +851,20 @@ int clock_gettime(clockid_t, struct timespec *);
  */
 #define MAX_PACKET_LENGTH      516     /* 7 + 506 + 3 */
 
+#define INTERNAL_SET(n)        ((gps_mask_t)(1llu<<(SET_HIGH_BIT+(n))))
+#define RAW_IS         INTERNAL_SET(1)         /* raw pseudoranges available */
+#define USED_IS        INTERNAL_SET(2)         /* sat-used count available */
+#define DRIVER_IS      INTERNAL_SET(3)         /* driver type identified */
+#define CLEAR_IS       INTERNAL_SET(4)         /* starts a reporting cycle */
+#define REPORT_IS      INTERNAL_SET(5)         /* ends a reporting cycle */
+#define NODATA_IS      INTERNAL_SET(6)         /* no data read from fd */
+#define PPSTIME_IS     INTERNAL_SET(7)         /* precision time is available 
*/
+#define PERR_IS        INTERNAL_SET(8)         /* PDOP set */
+#define PASSTHROUGH_IS         INTERNAL_SET(9)         /* passthrough mode */
+#define EOF_IS         INTERNAL_SET(10)        /* synthetic EOF */
+#define GOODTIME_IS    INTERNAL_SET(11)        /* time good even if no pos fix 
*/
+#define DATA_IS        ~(ONLINE_SET|PACKET_SET|CLEAR_IS|REPORT_IS)
+
 #define JSON_DATE_MAX  24      /* ISO8601 timestamp with 2 decimal places */
 
 #define GPSD_CONFIG_H
diff --git a/gpsd.h-tail b/gpsd.h-tail
index 892067a..607981d 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -291,20 +291,6 @@ typedef enum {
 } event_t;
 
 
-#define INTERNAL_SET(n)        ((gps_mask_t)(1llu<<(SET_HIGH_BIT+(n))))
-#define RAW_IS         INTERNAL_SET(1)         /* raw pseudoranges available */
-#define USED_IS        INTERNAL_SET(2)         /* sat-used count available */
-#define DRIVER_IS      INTERNAL_SET(3)         /* driver type identified */
-#define CLEAR_IS       INTERNAL_SET(4)         /* starts a reporting cycle */
-#define REPORT_IS      INTERNAL_SET(5)         /* ends a reporting cycle */
-#define NODATA_IS      INTERNAL_SET(6)         /* no data read from fd */
-#define PPSTIME_IS     INTERNAL_SET(7)         /* precision time is available 
*/
-#define PERR_IS        INTERNAL_SET(8)         /* PDOP set */
-#define PASSTHROUGH_IS         INTERNAL_SET(9)         /* passthrough mode */
-#define EOF_IS         INTERNAL_SET(10)        /* synthetic EOF */
-#define GOODTIME_IS    INTERNAL_SET(11)        /* time good even if no pos fix 
*/
-#define DATA_IS        ~(ONLINE_SET|PACKET_SET|CLEAR_IS|REPORT_IS)
-
 typedef unsigned int driver_mask_t;
 #define DRIVER_NOFLAGS 0x00000000u
 #define DRIVER_STICKY  0x00000001u
diff --git a/libgps_json.c b/libgps_json.c
index a806c4c..b899c6a 100644
--- a/libgps_json.c
+++ b/libgps_json.c
@@ -19,7 +19,7 @@ PERMISSIONS
 #include <string.h>
 #include <stddef.h>
 
-#include "gpsd.h"
+#include "libgps.h"
 #include "strfuncs.h"
 #ifdef SOCKET_EXPORT_ENABLE
 #include "gps_json.h"
diff --git a/maskaudit.py b/maskaudit.py
index 4805809..ace8185 100755
--- a/maskaudit.py
+++ b/maskaudit.py
@@ -119,7 +119,8 @@ if __name__ == '__main__':
 #include <stdio.h>
 #include <string.h>
 
-#include \"gpsd.h\"
+#include \"gpsd_config.h\"
+#include \"gps.h\"
 
 const char *gps_maskdump(gps_mask_t set)
 {
diff --git a/rtcm2_json.c b/rtcm2_json.c
index d094e94..6ed5228 100644
--- a/rtcm2_json.c
+++ b/rtcm2_json.c
@@ -18,7 +18,7 @@ PERMISSIONS
 #include <string.h>
 #include <stddef.h>
 
-#include "gpsd.h"
+#include "libgps.h"
 
 #ifdef SOCKET_EXPORT_ENABLE
 #include "gps_json.h"
diff --git a/rtcm3_json.c b/rtcm3_json.c
index 75f6678..19d5972 100644
--- a/rtcm3_json.c
+++ b/rtcm3_json.c
@@ -18,7 +18,7 @@ PERMISSIONS
 #include <string.h>
 #include <stddef.h>
 
-#include "gpsd.h"
+#include "libgps.h"
 
 #ifdef SOCKET_EXPORT_ENABLE
 #include "gps_json.h"
-- 
2.8.0.rc3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]