Skip to content

Commit e3e2fc4

Browse files
Include emscripten/fiber.h at global scope before minicoro.h (#1256)
minicoro.h includes <emscripten/fiber.h> 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 <emscripten/fiber.h> 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 <noreply@anthropic.com>
1 parent 3f61069 commit e3e2fc4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/action_node.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
#define MINICORO_IMPL
1515
#include "behaviortree_cpp/action_node.h"
1616

17+
// minicoro.h includes this inside extern "C": include it first, at global scope.
18+
#ifdef __EMSCRIPTEN__
19+
#include <emscripten/fiber.h>
20+
#endif
21+
1722
#include "minicoro.h"
1823

1924
#include <iostream>

0 commit comments

Comments
 (0)