Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/comms/direwolf/files/patch-dwgpsd.c
16124 views
1
--- dwgpsd.c.orig 2020-03-05 16:59:08 UTC
2
+++ dwgpsd.c
3
@@ -57,7 +57,10 @@
4
// Debian bug report: direwolf (1.2-1) FTBFS with libgps22 as part of the gpsd transition (#803605):
5
// dwgps.c claims to only support GPSD_API_MAJOR_VERSION 5, but also builds successfully with
6
// GPSD_API_MAJOR_VERSION 6 provided by libgps22 when the attached patch is applied.
7
-#if GPSD_API_MAJOR_VERSION < 5 || GPSD_API_MAJOR_VERSION > 6
8
+
9
+// Also compatible with API 9 with conditional compilation later.
10
+
11
+#if GPSD_API_MAJOR_VERSION < 5 || GPSD_API_MAJOR_VERSION > 9
12
#error libgps API version might be incompatible.
13
#endif
14
15
@@ -257,7 +260,19 @@ static void * read_gpsd_thread (void *arg)
16
/* Fall thru to read which should get error and bail out. */
17
}
18
19
+// https://github.com/wb2osz/direwolf/issues/196
20
+// https://bugzilla.redhat.com/show_bug.cgi?id=1674812
21
+
22
+// gps_read has two new parameters in API version 7.
23
+// It looks like this could be used to obtain the JSON message from the daemon.
24
+// Specify NULL, instead of message buffer space, if this is not desired.
25
+// Why couldn't they add a new function instead of introducing incompatibility?
26
+
27
+#if GPSD_API_MAJOR_VERSION >= 7
28
+ if (gps_read (&gpsdata, NULL, 0) == -1) {
29
+#else
30
if (gps_read (&gpsdata) == -1) {
31
+#endif
32
text_color_set(DW_COLOR_ERROR);
33
34
dw_printf ("------------------------------------------\n");
35
36