From 28c7c80032463cbe7c0d900c1930ccfdbe1f8b92 Mon Sep 17 00:00:00 2001 From: Junru Shao Date: Mon, 6 Nov 2023 09:05:18 -0800 Subject: [PATCH] Try fix macOS build with picojson The error message below ``` /usr/share/miniconda/envs/mlc-llm-build/conda-bld/mlc-chat-cli-nightly-package_1699286394016/work/3rdparty/tvm/3rdparty/picojson/picojson.h: In member function 'std::string picojson::value::to_str() const': /usr/share/miniconda/envs/mlc-llm-build/conda-bld/mlc-chat-cli-nightly-package_1699286394016/work/3rdparty/tvm/3rdparty/picojson/picojson.h:494:37: error: expected ')' before 'PRId64' 494 | SNPRINTF(buf, sizeof(buf), "%" PRId64, u_.int64_); | ~ ^~~~~~~ | ) /usr/share/miniconda/envs/mlc-llm-build/conda-bld/mlc-chat-cli-nightly-package_1699286394016/work/3rdparty/tvm/3rdparty/picojson/picojson.h:81:1: note: 'PRId64' is defined in header ''; did you forget to '#include '? 80 | #include +++ |+#include 81 | #include ``` indicates that the `__STDC_FORMAT_MACROS` flag is not turned on for some reason. --- cpp/json_parser.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/cpp/json_parser.h b/cpp/json_parser.h index b181c300a9..3505329660 100644 --- a/cpp/json_parser.h +++ b/cpp/json_parser.h @@ -2,9 +2,7 @@ #define MLC_LLM_CPP_JSON_PARSER_H_ #define PICOJSON_USE_INT64 -#ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS -#endif #include #include