# HG changeset patch # User Thomas Klausner # Date 1559140592 -7200 # Node ID cf411b1dcbbbf3908ab81e89560661aa474f2c4a # Parent 925470fbe59d1389e7ad16e0c63b52430be4fd22 Improve compatibility with old systems. Use c_str() to get C strings for printing. diff -r 925470fbe59d -r cf411b1dcbbb extensions/dict_json/json-schema-to-c.cc --- a/extensions/dict_json/json-schema-to-c.cc Sat May 18 17:58:48 2019 +0200 +++ b/extensions/dict_json/json-schema-to-c.cc Wed May 29 16:36:32 2019 +0200 @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -91,13 +92,13 @@ } off_t n = stat_buf.st_size; if (max_size > 0 && n > max_size) { - fprintf (stderr, "%s file [%s] is larger than %" PRIi64 " bytes\n", desc, filename, (int64_t)max_size); + fprintf (stderr, "%s file [%s] is larger than %lld bytes\n", desc, filename, (long long)max_size); fclose (fp); return NULL; } char *buf; if ((buf = (char *) malloc ((size_t)n+1)) == NULL) { - fprintf (stderr, "error allocating %" PRIi64 " bytes for read of %s file [%s]\n", (int64_t)n, desc, filename); + fprintf (stderr, "error allocating %lld bytes for read of %s file [%s]\n", (long long)n, desc, filename); fclose (fp); return NULL; } @@ -180,7 +181,7 @@ Json::Value json; if (!reader.parse(str, json)) { - fprintf(stderr, "%s: parse error: %s\n", input, reader.getFormattedErrorMessages()); + fprintf(stderr, "%s: parse error: %s\n", input, reader.getFormattedErrorMessages().c_str()); exit(1); }