From 3b46fcd180db352a4abed7db80d86ad933df7e16 Mon Sep 17 00:00:00 2001 From: Davide Faconti Date: Sat, 24 Oct 2026 16:22:01 +0200 Subject: [PATCH] Include emscripten/fiber.h at global scope before minicoro.h minicoro.h includes from inside its own extern "C" block when building for Emscripten. That pulls Emscripten's C++ headers (e.g. em_asm.h with its template specializations) in with C linkage, and the build fails with "explicit specialization of undeclared template struct '__em_asm_sig'". Include in action_node.cpp, the only translation unit that includes minicoro.h, before minicoro.h. The include guard then prevents the second inclusion under extern "C". The vendored minicoro.h is left untouched. Fixes #1226 Co-Authored-By: Claude Opus 5.5 --- src/action_node.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/action_node.cpp b/src/action_node.cpp index 77f1f440b..8e47ad940 100644 --- a/src/action_node.cpp +++ b/src/action_node.cpp @@ -14,6 +14,11 @@ #define MINICORO_IMPL #include "behaviortree_cpp/action_node.h" +// minicoro.h includes this inside extern "C": include it first, at global scope. +#ifdef __EMSCRIPTEN__ +#include +#endif + #include "minicoro.h" #include