diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-02-16 08:47:50 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-02-16 08:47:50 -0500 |
commit | 75960886a963dfc8ad828ee5ac056bea46588482 (patch) | |
tree | a39193ae300a62b3a2cea563815258e18409bc52 /gpsdecode.c | |
parent | a425161cab6a09d9850305f6fecd520f0d260b2b (diff) | |
download | gpsd-75960886a963dfc8ad828ee5ac056bea46588482.tar.gz |
Properly conditionalize gpsdecode in case AIDVM support is not compiled in.
Diffstat (limited to 'gpsdecode.c')
-rw-r--r-- | gpsdecode.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gpsdecode.c b/gpsdecode.c index 8f1f2122..70d6cde8 100644 --- a/gpsdecode.c +++ b/gpsdecode.c @@ -40,6 +40,7 @@ void gpsd_report(int errlevel, const char *fmt, ...) } } +#ifdef AIVDM_ENABLE static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) { (void)snprintf(buf, buflen, "%u|%u|%09u|", ais->type, ais->repeat, @@ -355,6 +356,7 @@ static void aivdm_csv_dump(struct ais_t *ais, char *buf, size_t buflen) /*@ +formatcode @*/ (void)strlcat(buf, "\r\n", buflen); } +#endif /*@ -compdestroy -compdef -usedef @*/ static void decode(FILE * fpin, FILE * fpout) @@ -393,6 +395,7 @@ static void decode(FILE * fpin, FILE * fpout) rtcm3_dump(&rtcm3, stdout); } #endif +#ifdef AIVDM_ENABLE else if (lexer.type == AIVDM_PACKET) { if (verbose >= 1) (void)fputs((char *)lexer.outbuffer, stdout); @@ -405,8 +408,8 @@ static void decode(FILE * fpin, FILE * fpout) json_aivdm_dump(&ais, NULL, scaled, buf, sizeof(buf)); (void)fputs(buf, fpout); } - /*@ +uniondef */ +#endif /* AIVDM_ENABLE */ } } } @@ -435,17 +438,21 @@ static void encode(FILE * fpin, FILE * fpout) status, json_error_string(status), lineno); exit(1); } +#ifdef RTCM104V2_ENABLE if ((gpsdata.set & RTCM2_SET) != 0) { /* this works */ char outbuf[BUFSIZ]; json_rtcm2_dump(&gpsdata.rtcm2, NULL, outbuf, sizeof(outbuf)); (void)fputs(outbuf, fpout); } +#endif +#ifdef AIVDM_ENABLE if ((gpsdata.set & AIS_SET) != 0) { char outbuf[BUFSIZ]; json_aivdm_dump(&gpsdata.ais, NULL, false, outbuf, sizeof(outbuf)); (void)fputs(outbuf, fpout); } +#endif /* AIVDM_ENABLE */ } } |