Skip to content

Commit

Permalink
[Relax][VM] Add additional flags for picojson
Browse files Browse the repository at this point in the history
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 '<cinttypes>'; did you forget to '#include <cinttypes>'?
   80 | #include <errno.h>
  +++ |+#include <cinttypes>
   81 | #include <inttypes.h>
```
  • Loading branch information
junrushao committed Sep 13, 2023
1 parent e6c03dc commit 4639f26
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/runtime/relax_vm/ndarray_cache_support.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 <picojson.h>
Expand Down

0 comments on commit 4639f26

Please sign in to comment.