gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH] gpsmon: fix build when reconfigure is false


From: spdawson
Subject: [gpsd-dev] [PATCH] gpsmon: fix build when reconfigure is false
Date: Sun, 8 Dec 2013 10:17:27 +0000

From: Simon Dawson <address@hidden>

When reconfigure is False and ncurses support is enabled, the build fails as
follows.


gpsmon.o: In function `gpsd_write':
gpsmon.c:(.text+0xbbc): undefined reference to `monitor_dump_send'
gpsmon.o: In function `main':
gpsmon.c:(.text.startup+0xd68): undefined reference to `announce_log'
collect2: error: ld returned 1 exit status
scons: *** [gpsmon] Error 1
scons: building terminated because of errors.


The problem appears to be a failure to protect calls to momnitor_dump_send
and announce_log with appropriate #ifdef guards.

Signed-off-by: Simon Dawson <address@hidden>
---
 gpsmon.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gpsmon.c b/gpsmon.c
index 106e080..de1f14b 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -632,7 +632,9 @@ ssize_t gpsd_write(struct gps_device_t *session,
                   const size_t len)
 /* pass low-level data to devices, echoing it to the log window */
 {
+#if defined(CONTROLSEND_ENABLE) || defined(RECONFIGURE_ENABLE)
     monitor_dump_send((const char *)buf, len);
+#endif /* defined(CONTROLSEND_ENABLE) || defined(RECONFIGURE_ENABLE) */
     return gpsd_serial_write(session, buf, len);
 }
 
@@ -823,7 +825,9 @@ static bool do_command(const char *line)
                context.readonly = !context.readonly;
            else
                context.readonly = (atoi(line + 1) == 0);
+#ifdef RECONFIGURE_ENABLE
            announce_log("[probing %sabled]", context.readonly ? "dis" : "en");
+#endif /* RECONFIGURE_ENABLE */
            if (!context.readonly)
                /* magic - forces a reconfigure */
                session.packet.counter = 0;
-- 
1.8.3.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]