From 4639f260c967ade53a893b9d637ff6e53beb40d6 Mon Sep 17 00:00:00 2001 From: Junru Shao Date: Tue, 12 Sep 2023 20:02:01 -0700 Subject: [PATCH] [Relax][VM] Add additional flags for picojson This commits adds `__STDC_FORMAT_MACROS` when including picojson in C++. This should fix a recent build issue as below: ``` In file included from src/runtime/relax_vm/ndarray_cache_support.cc:40: 3rdparty/picojson/picojson.h: In member function 'std::string picojson::value::to_str() const': 3rdparty/picojson/picojson.h:494:37: error: expected ')' before 'PRId64' 494 | SNPRINTF(buf, sizeof(buf), "%" PRId64, u_.int64_); | ~ ^~~~~~~ | ) 3rdparty/picojson/picojson.h:81:1: note: 'PRId64' is defined in header ''; did you forget to '#include '? 80 | #include +++ |+#include 81 | #include ``` --- src/runtime/relax_vm/ndarray_cache_support.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runtime/relax_vm/ndarray_cache_support.cc b/src/runtime/relax_vm/ndarray_cache_support.cc index da24a1392d..3a5e961fe1 100644 --- a/src/runtime/relax_vm/ndarray_cache_support.cc +++ b/src/runtime/relax_vm/ndarray_cache_support.cc @@ -35,6 +35,9 @@ * runtime builtin provide as in this file. */ #define PICOJSON_USE_INT64 +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS +#endif #include "./ndarray_cache_support.h" #include