summaryrefslogtreecommitdiff
path: root/libgpsmm.h
diff options
context:
space:
mode:
authorDavid Favro <gpsd@meta-dynamic.com>2010-11-09 01:38:49 -0500
committerJon Schlueter <jon.schlueter@gmail.com>2010-11-09 13:45:53 -0500
commite602f98413fcfbccf8b1013e7ef530d1301965df (patch)
tree01eddd4559f08fbab4b58b41cacc12358f79537f /libgpsmm.h
parent51fc775e8b7c08608fb2e4412bd31d73421037f4 (diff)
downloadgpsd-e602f98413fcfbccf8b1013e7ef530d1301965df.tar.gz
Ported libgpsmm to major-version 5.
It had been completely non-functional since change in parameters to gps_open(). libgpsmm: bug-fix of the port to libgps major-version 5. * Previously, if a gpsmm were constructed, not successfully opened, then destroyed, gps_close() would have still been called. * The new version of libgpsmm may now be backwardsly compatible with libgps major-version<5, although it's not clear why anyone would do that. Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
Diffstat (limited to 'libgpsmm.h')
-rw-r--r--libgpsmm.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/libgpsmm.h b/libgpsmm.h
index 9b41d983..ab57a286 100644
--- a/libgpsmm.h
+++ b/libgpsmm.h
@@ -30,9 +30,15 @@ class LIBQGPSMMSHARED_EXPORT gpsmm {
void clear_fix(void);
void enable_debug(int, FILE*);
private:
- struct gps_data_t *gps_data;
struct gps_data_t *to_user; //we return the user a copy of the internal structure. This way she can modify it without
//integrity loss for the entire class
- struct gps_data_t* backup(void) { *to_user=*gps_data; return to_user;}; //return the backup copy
+ #if GPSD_API_MAJOR_VERSION < 5
+ struct gps_data_t *_gps_data;
+ struct gps_data_t * gps_data() { return _gps_data; }
+ #else
+ struct gps_data_t _gps_data;
+ struct gps_data_t * gps_data() { return &_gps_data; }
+ #endif
+ struct gps_data_t* backup(void) { *to_user=*gps_data(); return to_user;}; //return the backup copy
};
#endif // _GPSD_GPSMM_H_