From c0aa3422a02ceec696b322cce13c79bd5a497b05 Mon Sep 17 00:00:00 2001 From: Daniel9z Date: Fri, 6 Dec 2024 10:45:11 -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. (#60) 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