Fix build against gpsd >= 3.20 #1
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "osmith/gpsdate:osmith/wip"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Note that in meta-sysmocom-bsp, we have the commit hardcoded. It won't automatically try to build the new version after merge.
@ -42,6 +42,10 @@
#include <gps.h>
#if GPSD_API_MAJOR_VERSION < 11
I'd rather keep supporting older versions by means of ifdef in relevant code parts, or having a function helper defined for different versions. IIRC we are already doing that in some places?
I agree. the tool is a generic open source tool we released (and also announced on the gpsd mailing list when it was created). So we shouldn't constrain it to support only the absolutely latest gpsd client/API versions, but maintain compatibility.
Done
d28feb6cb2
to54593d77f8
@ -120,7 +125,11 @@ static int my_gps_mainloop(struct gps_data_t *gdata,
if (!gps_waiting(gdata, timeout)) {
return -1;
} else {
#if GPSD_API_MAJOR_VERSION >= 7
For this gps_read() function since we always call it with one "variable" param in then, the best is to do a shim. I recall doing that somewhere already in gpsdata or gpsd in the past, look around. Something like:
int compat_gps_read(one_param) {
#if GPSD_API_MAJOR_VERSION >= 7
return gps_read(gdata, NULL, 0);
#else
return gps_read(gdata);
#endif
}
and then use compat_gps_read in all places.
Done, found it here:
https://gerrit.osmocom.org/c/osmocom-bb/+/11609
54593d77f8
to68bcf620b4