From 2fb1eb91364347e1afae57314eee3279a1b1b7d0 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Sat, 5 Mar 2022 02:26:32 +0100 Subject: [PATCH] Print file paths in a platform-independent way Conversion may be unspecified, but Windows better do the right thing (or else.) --- src/gfx/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gfx/main.cpp b/src/gfx/main.cpp index ba2544d1..78b364a3 100644 --- a/src/gfx/main.cpp +++ b/src/gfx/main.cpp @@ -296,7 +296,13 @@ int main(int argc, char *argv[]) { options.maxNbTiles[0], options.maxNbTiles[1]); auto printPath = [](char const *name, std::filesystem::path const &path) { if (!path.empty()) { - fprintf(stderr, "\t%s: %s\n", name, path.c_str()); +#ifdef _MSC_VER + #define PRIpath "ls" +#else + #define PRIpath "s" +#endif + fprintf(stderr, "\t%s: %" PRIpath "\n", name, path.c_str()); +#undef PRIpath } }; printPath("Input image", options.input);