Skip to content

Commit 403935b

Browse files
committed
Fix missing <cstdlib> include for Emscripten web builds
Compiling `godot-cpp` for the Web platform (`wasm32`) using Emscripten currently fails in `src/godot.cpp` with the following error: `error: use of undeclared identifier 'realloc'` Unlike, for instance, GCC on Linux, Emscripten's Clang compiler strictly requires `<cstdlib>` to be explicitly included to use standard memory allocation functions like `realloc`. This commit adds the missing header alongside `<stdio.h>` to resolve the build failure and ensure cross-platform compatibility.
1 parent 9ae37ac commit 403935b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/godot.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <godot_cpp/core/error_macros.hpp>
4242

4343
#include <stdio.h>
44+
#include <cstdlib>
4445

4546
namespace godot {
4647

0 commit comments

Comments
 (0)