Skip to content

Commit

Permalink
Use HAVE_ICONV as conditional compile
Browse files Browse the repository at this point in the history
  • Loading branch information
markwal committed Nov 27, 2020
1 parent 68c11a6 commit 61d1ce5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gpx/gpxresp.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@
#include <errno.h>
#ifndef _WIN32
#include <sys/select.h>
#include <iconv.h>
#endif

#include "gpx.h"

#ifdef HAVE_POLL_H
#include <poll.h>
#endif
#ifdef HAVE_ICONV
#include <iconv.h>
#endif

// make a new string table
// cs_chunk -- count of strings -- grow the string array in chunks of this many strings
Expand Down Expand Up @@ -312,7 +314,7 @@ static void translate_extruder_query_response(Gpx *gpx, Tio *tio, unsigned query
// FUTURE proper decode here (to UTF8?)
static void sanitize_filename(char *filename)
{
#ifndef _WIN32
#ifdef HAVE_ICONV
char buf[PROTOCOL_FILENAME_MAX];
iconv_t cd = iconv_open("WINDOWS-1252", "ASCII//TRANSLIT");
size_t inremain = strlen(filename);
Expand All @@ -329,7 +331,6 @@ static void sanitize_filename(char *filename)
return;
}
// fallthrough to strip
// FUTURE WIN32 equivalent APIs
#endif

for (; *filename; filename++) {
Expand Down

0 comments on commit 61d1ce5

Please sign in to comment.