Address Savannah bug #46082 - Can't explicitly build with NMEA drivers.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 2 Oct 2015 00:37:28 +0000 (20:37 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 2 Oct 2015 00:37:28 +0000 (20:37 -0400)
17 files changed:
driver_evermore.c
driver_italk.c
driver_navcom.c
driver_nmea0183.c
driver_oncore.c
driver_proto.c
driver_sirf.c
driver_superstar2.c
driver_ubx.c
drivers.c
gpsd.h-tail
gpsmon.c
libgpsd_core.c
monitor_nmea0183.c
packet.c
packet_states.h
timebase.c

index ba10611..be040e8 100644 (file)
@@ -385,12 +385,12 @@ static gps_mask_t evermore_parse_input(struct gps_device_t *session)
                            session->lexer.outbuflen);
        return st;
     }
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     else if (session->lexer.type == NMEA_PACKET) {
        st = nmea_parse((char *)session->lexer.outbuffer, session);
        return st;
     }
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     else
        return 0;
 }
index c24c034..7bd47d1 100644 (file)
@@ -384,10 +384,10 @@ static gps_mask_t italk_parse_input(struct gps_device_t *session)
     if (session->lexer.type == ITALK_PACKET) {
        return italk_parse(session, session->lexer.outbuffer,
                           session->lexer.outbuflen);;
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     } else if (session->lexer.type == NMEA_PACKET) {
        return nmea_parse((char *)session->lexer.outbuffer, session);
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     } else
        return 0;
 }
index e34a8b8..081cee1 100644 (file)
@@ -1150,10 +1150,10 @@ static gps_mask_t navcom_parse_input(struct gps_device_t *session)
     if (session->lexer.type == NAVCOM_PACKET) {
        return navcom_parse(session, session->lexer.outbuffer,
                          session->lexer.outbuflen);
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     } else if (session->lexer.type == NMEA_PACKET) {
        return nmea_parse((char *)session->lexer.outbuffer, session);;
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     } else
        return 0;
 }
index 996ddfc..61aaa04 100644 (file)
@@ -13,7 +13,7 @@
 #include "gpsd.h"
 #include "strfuncs.h"
 
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
 /**************************************************************************
  *
  * Parser helpers begin here
@@ -1587,7 +1587,7 @@ gps_mask_t nmea_parse(char *sentence, struct gps_device_t * session)
     return retval;
 }
 
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 
 void nmea_add_checksum(char *sentence)
 /* add NMEA checksum to a possibly  *-terminated sentence */
index a023529..f4338b7 100644 (file)
@@ -468,10 +468,10 @@ static gps_mask_t oncore_parse_input(struct gps_device_t *session)
     if (session->lexer.type == ONCORE_PACKET) {
        return oncore_dispatch(session, session->lexer.outbuffer,
                             session->lexer.outbuflen);
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     } else if (session->lexer.type == NMEA_PACKET) {
        return nmea_parse((char *)session->lexer.outbuffer, session);
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     } else
        return 0;
 }
index d6c61c8..f42cfcc 100644 (file)
@@ -420,10 +420,10 @@ static gps_mask_t _proto__parse_input(struct gps_device_t *session)
 {
     if (session->lexer.type == _PROTO__PACKET) {
        return _proto__dispatch(session, session->lexer.outbuffer, session->lexer.outbuflen);
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     } else if (session->lexer.type == NMEA_PACKET) {
        return nmea_parse((char *)session->lexer.outbuffer, session);
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     } else
        return 0;
 }
index e3699c8..945f6c1 100644 (file)
@@ -1367,10 +1367,10 @@ static gps_mask_t sirfbin_parse_input(struct gps_device_t *session)
     if (session->lexer.type == SIRF_PACKET) {
        return sirf_parse(session, session->lexer.outbuffer,
                        session->lexer.outbuflen);
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     } else if (session->lexer.type == NMEA_PACKET) {
        return nmea_parse((char *)session->lexer.outbuffer, session);
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     } else
        return 0;
 }
index 6e197d3..bd4aab1 100644 (file)
@@ -468,10 +468,10 @@ static gps_mask_t superstar2_parse_input(struct gps_device_t *session)
     if (session->lexer.type == SUPERSTAR2_PACKET) {
        return superstar2_dispatch(session, session->lexer.outbuffer,
                                   session->lexer.length);;
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     } else if (session->lexer.type == NMEA_PACKET) {
        return nmea_parse((char *)session->lexer.outbuffer, session);
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     } else
        return 0;
 }
index fe50946..41ff709 100644 (file)
@@ -633,10 +633,10 @@ static gps_mask_t parse_input(struct gps_device_t *session)
     if (session->lexer.type == UBX_PACKET) {
        return ubx_parse(session, session->lexer.outbuffer,
                         session->lexer.outbuflen);
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     } else if (session->lexer.type == NMEA_PACKET) {
        return nmea_parse((char *)session->lexer.outbuffer, session);
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     } else
        return 0;
 }
index edd6a7d..de5ce78 100644 (file)
--- a/drivers.c
+++ b/drivers.c
@@ -27,7 +27,7 @@ gps_mask_t generic_parse_input(struct gps_device_t *session)
     else if (session->lexer.type == COMMENT_PACKET) {
        gpsd_set_century(session);
        return 0;
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     } else if (session->lexer.type == NMEA_PACKET) {
        const struct gps_type_t **dp;
        gps_mask_t st = 0;
@@ -61,7 +61,7 @@ gps_mask_t generic_parse_input(struct gps_device_t *session)
            }
        }
        return st;
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     } else {
        gpsd_log(&session->context->errout, LOG_SHOUT,
                 "packet type %d fell through (should never happen): %s.\n",
@@ -104,7 +104,7 @@ const struct gps_type_t driver_unknown = {
 };
 /* *INDENT-ON* */
 
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
 /**************************************************************************
  *
  * NMEA 0183
@@ -144,14 +144,14 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
         * unless there is actual following data.
         */
        switch (session->lexer.counter) {
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
        case 0:
            /* probe for Garmin serial GPS -- expect $PGRMC followed by data */
            gpsd_log(&session->context->errout, LOG_PROG,
                     "=> Probing for Garmin NMEA\n");
            (void)nmea_send(session, "$PGRMCE");
            break;
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 #ifdef SIRF_ENABLE
        case 1:
            /*
@@ -181,7 +181,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
            session->back_to_nmea = true;
            break;
 #endif /* SIRF_ENABLE */
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
        case 2:
            /* probe for the FV-18 -- expect $PFEC,GPint followed by data */
            gpsd_log(&session->context->errout, LOG_PROG,
@@ -194,7 +194,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
                     "=> Probing for Trimble Copernicus\n");
            (void)nmea_send(session, "$PTNLSNM,0139,01");
            break;
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 #ifdef EVERMORE_ENABLE
        case 4:
            gpsd_log(&session->context->errout, LOG_PROG,
@@ -276,7 +276,7 @@ const struct gps_type_t driver_nmea0183 = {
 };
 /* *INDENT-ON* */
 
-#if defined(GARMIN_ENABLE) && defined(NMEA_ENABLE)
+#if defined(GARMIN_ENABLE) && defined(NMEA0183_ENABLE)
 /**************************************************************************
  *
  * Garmin NMEA
@@ -377,7 +377,7 @@ const struct gps_type_t driver_garmin = {
 #endif /* TIMEHINT_ENABLE */
 };
 /* *INDENT-ON* */
-#endif /* GARMIN_ENABLE && NMEA_ENABLE */
+#endif /* GARMIN_ENABLE && NMEA0183_ENABLE */
 
 #ifdef ASHTECH_ENABLE
 /**************************************************************************
@@ -641,7 +641,7 @@ static const struct gps_type_t driver_earthmate = {
 /* *INDENT-ON* */
 #endif /* EARTHMATE_ENABLE */
 
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 
 #ifdef TNT_ENABLE
 /**************************************************************************
@@ -1351,10 +1351,10 @@ static gps_mask_t aivdm_analyze(struct gps_device_t *session)
            return ONLINE_SET | AIS_SET;
        } else
            return ONLINE_SET;
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     } else if (session->lexer.type == NMEA_PACKET) {
        return nmea_parse((char *)session->lexer.outbuffer, session);
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     } else
        return 0;
 }
@@ -1548,7 +1548,7 @@ extern const struct gps_type_t driver_zodiac;
 /* the point of this rigamarole is to not have to export a table size */
 static const struct gps_type_t *gpsd_driver_array[] = {
     &driver_unknown,
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     &driver_nmea0183,
 #ifdef ASHTECH_ENABLE
     &driver_ashtech,
@@ -1583,7 +1583,7 @@ static const struct gps_type_t *gpsd_driver_array[] = {
 #ifdef AIVDM_ENABLE
     &driver_aivdm,
 #endif /* AIVDM_ENABLE */
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 
 #ifdef EVERMORE_ENABLE
     &driver_evermore,
index 829a86e..b76e7ce 100644 (file)
@@ -46,8 +46,8 @@
 #if !defined(AIVDM_ENABLE) && defined(NMEA2000_ENABLE)
 #define AIVDM_ENABLE
 #endif
-#if !defined(NMEA_ENABLE) && (defined(FV18_ENABLE) || defined(MTK3301_ENABLE) || defined(TNT_ENABLE) || defined(OCEANSERVER_ENABLE) || defined(GPSCLOCK_ENABLE) || defined(FURY_ENABLE))
-#define NMEA_ENABLE
+#if !defined(NMEA0183_ENABLE) && (defined(FV18_ENABLE) || defined(MTK3301_ENABLE) || defined(TNT_ENABLE) || defined(OCEANSERVER_ENABLE) || defined(GPSCLOCK_ENABLE) || defined(FURY_ENABLE))
+#define NMEA0183_ENABLE
 #endif
 #ifdef EARTHMATE_ENABLE
 #define ZODIAC_ENABLE
@@ -485,7 +485,7 @@ struct gps_device_t {
     int fixcnt;                                /* count of fixes from this device */
     struct gps_fix_t newdata;          /* where drivers put their data */
     struct gps_fix_t oldfix;           /* previous fix for error modeling */
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     struct {
        unsigned short sats_used[MAXCHANNELS];
        int part, await;                /* for tracking GSV parts */
@@ -515,7 +515,7 @@ struct gps_device_t {
        unsigned int cycle_enders;
        bool cycle_continue;
     } nmea;
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
     /*
      * The rest of this structure is driver-specific private storage.
      * Only put a driver's scratch storage in here if it is never
index 58c8300..3b7a4fb 100644 (file)
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -39,9 +39,9 @@ extern struct monitor_object_t garmin_mmt, garmin_bin_ser_mmt;
 extern struct monitor_object_t italk_mmt, ubx_mmt, superstar2_mmt;
 extern struct monitor_object_t fv18_mmt, gpsclock_mmt, mtk3301_mmt;
 extern struct monitor_object_t oncore_mmt, tnt_mmt, aivdm_mmt;
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
 extern const struct gps_type_t driver_nmea0183;
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 
 /* These are public */
 struct gps_device_t session;
@@ -76,11 +76,11 @@ const struct monitor_object_t json_mmt = {
 #endif /* PASSTHROUGH_ENABLE */
 
 static const struct monitor_object_t *monitor_objects[] = {
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     &nmea_mmt,
-#if defined(GARMIN_ENABLE) && defined(NMEA_ENABLE)
+#if defined(GARMIN_ENABLE) && defined(NMEA0183_ENABLE)
     &garmin_mmt,
-#endif /* GARMIN_ENABLE && NMEA_ENABLE */
+#endif /* GARMIN_ENABLE && NMEA0183_ENABLE */
 #if defined(GARMIN_ENABLE) && defined(BINARY_ENABLE)
     &garmin_bin_ser_mmt,
 #endif /* defined(GARMIN_ENABLE) && defined(BINARY_ENABLE) */
@@ -99,7 +99,7 @@ static const struct monitor_object_t *monitor_objects[] = {
 #ifdef AIVDM_ENABLE
     &aivdm_mmt,
 #endif /* AIVDM_ENABLE */
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 #if defined(SIRF_ENABLE) && defined(BINARY_ENABLE)
     &sirf_mmt,
 #endif /* defined(SIRF_ENABLE) && defined(BINARY_ENABLE) */
@@ -561,11 +561,11 @@ static void select_packet_monitor(struct gps_device_t *device)
      */
     if (device->lexer.type != last_type) {
        const struct gps_type_t *active_type = device->device_type;
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
        if (device->lexer.type == NMEA_PACKET
            && ((device->device_type->flags & DRIVER_STICKY) != 0))
            active_type = &driver_nmea0183;
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
        if (!switch_type(active_type))
            longjmp(terminate, TERM_DRIVER_SWITCH);
        else {
index a241e55..31fec2a 100644 (file)
@@ -560,7 +560,7 @@ int gpsd_activate(struct gps_device_t *session, const int mode)
        return session->gpsdata.gps_fd;
     }
 
-#ifdef NON_NMEA_ENABLE
+#ifdef NON_NMEA0183_ENABLE
     /* if it's a sensor, it must be probed */
     if ((session->servicetype == service_sensor) &&
        (session->sourcetype != source_can)) {
@@ -590,7 +590,7 @@ int gpsd_activate(struct gps_device_t *session, const int mode)
                 "no probe matched...\n");
     }
 foundit:
-#endif /* NON_NMEA_ENABLE */
+#endif /* NON_NMEA0183_ENABLE */
 
     gpsd_clear(session);
     gpsd_log(&session->context->errout, LOG_INF,
index e664f9a..be48790 100644 (file)
@@ -19,7 +19,7 @@
 #include "gpsdclient.h"
 #include "strfuncs.h"
 
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
 extern const struct gps_type_t driver_nmea0183;
 
 static WINDOW *cookedwin, *nmeawin, *satwin, *gprmcwin, *gpggawin, *gpgsawin, *gpgstwin;
@@ -390,7 +390,7 @@ static void monitor_nmea_send(const char *fmt, ...)
  * display or implement device-specific commands.
  */
 
-#if defined(GARMIN_ENABLE) && defined(NMEA_ENABLE)
+#if defined(GARMIN_ENABLE) && defined(NMEA0183_ENABLE)
 extern const struct gps_type_t driver_garmin;
 
 const struct monitor_object_t garmin_mmt = {
@@ -401,7 +401,7 @@ const struct monitor_object_t garmin_mmt = {
     .min_y = 21,.min_x = 80,
     .driver = &driver_garmin,
 };
-#endif /* GARMIN_ENABLE && NMEA_ENABLE */
+#endif /* GARMIN_ENABLE && NMEA0183_ENABLE */
 
 #ifdef ASHTECH_ENABLE
 extern const struct gps_type_t driver_ashtech;
@@ -524,4 +524,4 @@ const struct monitor_object_t aivdm_mmt = {
     .driver = &driver_aivdm,
 };
 #endif /* AIVDM_ENABLE */
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
index c8b64f5..4ba40e5 100644 (file)
--- a/packet.c
+++ b/packet.c
@@ -225,7 +225,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
            lexer->state = COMMENT_BODY;
            break;
        }
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
        if (c == '$') {
            lexer->state = NMEA_DOLLAR;
            break;
@@ -234,7 +234,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
            lexer->state = NMEA_BANG;
            break;
        }
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 #if defined(TNT_ENABLE) || defined(GARMINTXT_ENABLE) || defined(ONCORE_ENABLE)
        if (c == '@') {
 #ifdef RTCM104V2_ENABLE
@@ -345,7 +345,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
        else if (!isprint(c))
            return character_pushback(lexer, GROUND_STATE);
        break;
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
     case NMEA_DOLLAR:
        if (c == 'G')
            lexer->state = NMEA_PUB_LEAD;
@@ -788,7 +788,7 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
        else
            return character_pushback(lexer, GROUND_STATE);
        break;
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 #ifdef SIRF_ENABLE
     case SIRF_LEADER_1:
        if (c == 0xa2)
@@ -1118,10 +1118,10 @@ static bool nextstate(struct gps_lexer_t *lexer, unsigned char c)
     case UBX_RECOGNIZED:
        if (c == 0xb5)
            lexer->state = UBX_LEADER_1;
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
        else if (c == '$')      /* LEA-5H can and will output NMEA and UBX back to back */
            lexer->state = NMEA_DOLLAR;
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 #ifdef PASSTHROUGH_ENABLE
        else if (c == '{')
            return character_pushback(lexer, JSON_LEADER);
@@ -1526,7 +1526,7 @@ void packet_parse(struct gps_lexer_t *lexer)
            lexer->state = GROUND_STATE;
            break;
        }
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
        else if (lexer->state == NMEA_RECOGNIZED) {
            /*
             * $PASHR packets have no checksum. Avoid the possibility
@@ -1591,7 +1591,7 @@ void packet_parse(struct gps_lexer_t *lexer)
            packet_discard(lexer);
            break;
        }
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 #ifdef SIRF_ENABLE
        else if (lexer->state == SIRF_RECOGNIZED) {
            unsigned char *trailer = lexer->inbufptr - 4;
index 22dbccf..8839b98 100644 (file)
@@ -4,7 +4,7 @@
    COMMENT_BODY,       /* pound comment for a test load */
    COMMENT_RECOGNIZED, /* comment recognized */
 
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
    NMEA_DOLLAR,                /* we've seen first character of NMEA leader */
    NMEA_BANG,          /* we've seen first character of an AIS message '!' */
    NMEA_PUB_LEAD,      /* seen second character of NMEA G leader */
@@ -37,7 +37,7 @@
    TRANSDUCER_LEAD_1,  /* Generic transducer packet leader 'Y' */
    BEIDOU_LEAD_1,      /* Beidou leader */
    QZSS_LEAD_1,                /* Quasi-Zenith Satellite System leader */
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 
    DLE_LEADER,         /* we've seen the TSIP/EverMore leader (DLE) */
 
index 0b3192e..b2e7939 100644 (file)
@@ -259,7 +259,7 @@ void gpsd_set_century(struct gps_device_t *session)
     }
 }
 
-#ifdef NMEA_ENABLE
+#ifdef NMEA0183_ENABLE
 timestamp_t gpsd_utc_resolve(struct gps_device_t *session)
 /* resolve a UTC date, checking for rollovers */
 {
@@ -321,7 +321,7 @@ void gpsd_century_update(struct gps_device_t *session, int century)
        session->context->valid &=~ CENTURY_VALID;
     }
 }
-#endif /* NMEA_ENABLE */
+#endif /* NMEA0183_ENABLE */
 
 timestamp_t gpsd_gpstime_resolve(struct gps_device_t *session,
                         unsigned short week, double tow)