From 1c25e7041c32894ed92e6e7624dc200d49641273 Mon Sep 17 00:00:00 2001 From: Daniel9z Date: Thu, 5 Dec 2024 17:03:13 -0500 Subject: [PATCH] The ValKind::operator<< uses ostream, but the include was missing. ostream is used so commonly that it's usually included by some other header. However, if you use wasmtime.hh as your first (or only) include, then you get a massive compile error on Apple toolchain compilers (I'm using xcode 16). The error does not reproduce on Linux. The error when this include is missing is: ``` include/wasmtime.hh:519:32: error: invalid operands to binary expression ('std::ostream' (aka 'basic_ostream') and 'const char[4]') 519 | WASMTIME_FOR_EACH_VAL_KIND(CASE_KIND_PRINT_NAME) third-party/wasmtime-cpp/include/wasmtime.hh:504:3: note: expanded from macro 'WASMTIME_FOR_EACH_VAL_KIND' 504 | X(I32, "i32", WASM_I32) \ | ^~~~~~~~~~~~~~~~~~~~~~~ third-party/wasmtime-cpp/include/wasmtime.hh:517:8: note: expanded from macro 'CASE_KIND_PRINT_NAME' 517 | os << name; \ ``` --- examples/hello.cc | 2 +- include/wasmtime.hh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/hello.cc b/examples/hello.cc index 46f3997..2362ba7 100644 --- a/examples/hello.cc +++ b/examples/hello.cc @@ -1,7 +1,7 @@ +#include #include #include #include -#include using namespace wasmtime; diff --git a/include/wasmtime.hh b/include/wasmtime.hh index c11a689..921966e 100644 --- a/include/wasmtime.hh +++ b/include/wasmtime.hh @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #ifdef __has_include