pud: fix the build against libgpsd 3.18
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 2 May 2019 18:36:46 +0000 (20:36 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 2 May 2019 19:34:18 +0000 (21:34 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/gpsdclient.c

index 0019d98..9e7fb70 100644 (file)
@@ -578,7 +578,13 @@ void readFromGpsd(GpsDaemon *gpsd, struct gps_data_t *gpsdata, struct GpsdConnec
   if (!connectionTracking->connected) {
     gpsReadCode = -1;
   } else {
+#if ((GPSD_API_MAJOR_VERSION >= 7) && (GPSD_API_MINOR_VERSION >= 0))
+    char msg[] = "\0";
+    int msg_len = 1;
+    gpsReadCode = gps_read(gpsdata, msg, msg_len);
+#else
     gpsReadCode = gps_read(gpsdata);
+#endif
   }
 
   if (gpsReadCode > 0) {