diff options
author | Robert Norris <rw_norris@hotmail.com> | 2016-07-14 19:37:09 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2016-07-14 19:37:09 -0700 |
commit | 7cca7d9c3cc41f0aeb647192a5f832dde49a161d (patch) | |
tree | 388298a26c776fa1f9e10b9c4f7e415690072e49 /test_libgps.c | |
parent | 0eb09952211bc28f2af29a9b405ac4f651b0e900 (diff) | |
download | gpsd-7cca7d9c3cc41f0aeb647192a5f832dde49a161d.tar.gz |
Building test_libgps can fail with specifc build options.
test_libgps will fail with this build command:
scons shared=True socket_export=True minimal=True test_libgps
resulting with undefined reference to 'libgps_dump_state' errors
As test_libgps would force debugging on, yet libgps_dump_state() is
compiled out.
Simply wrap libgps_dump_state() calls with suitable ifdefs
and don't force the LIBGPS_DEBUG define in code.
Signed-off-by: Gary E. Miller <gem@rellim.com>
Diffstat (limited to 'test_libgps.c')
-rw-r--r-- | test_libgps.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test_libgps.c b/test_libgps.c index 1102c35d..391f353d 100644 --- a/test_libgps.c +++ b/test_libgps.c @@ -10,8 +10,6 @@ #include <stdarg.h> #include <ctype.h> -#define LIBGPS_DEBUG - #include "gps.h" #include "libgps.h" #include "gpsdclient.h" @@ -94,7 +92,9 @@ int main(int argc, char *argv[]) while (fgets(buf, sizeof(buf), stdin) != NULL) { if (buf[0] == '{' || isalpha(buf[0])) { gps_unpack(buf, &gpsdata); +#ifdef LIBGPS_DEBUG libgps_dump_state(&gpsdata); +#endif } } #endif @@ -107,8 +107,10 @@ int main(int argc, char *argv[]) (void)gps_send(&collect, fmsg); (void)gps_read(&collect); #ifdef SOCKET_EXPORT_ENABLE +#ifdef LIBGPS_DEBUG libgps_dump_state(&collect); #endif +#endif (void)gps_close(&collect); } else { int tty = isatty(0); @@ -127,8 +129,10 @@ int main(int argc, char *argv[]) (void)gps_send(&collect, buf); (void)gps_read(&collect); #ifdef SOCKET_EXPORT_ENABLE +#ifdef LIBGPS_DEBUG libgps_dump_state(&collect); #endif +#endif } (void)gps_close(&collect); } |