diff --git a/core/src/main/resources/org/teavm/backend/c/core.h b/core/src/main/resources/org/teavm/backend/c/core.h index 1fe008b74..72e10ff7f 100644 --- a/core/src/main/resources/org/teavm/backend/c/core.h +++ b/core/src/main/resources/org/teavm/backend/c/core.h @@ -7,6 +7,11 @@ #include "memory.h" #include "exceptions.h" +#if TEAVM_MEMORY_TRACE + #include "heaptrace.h" + #include +#endif + typedef struct TeaVM_Object { int32_t header; int32_t hash; diff --git a/core/src/main/resources/org/teavm/backend/c/definitions.h b/core/src/main/resources/org/teavm/backend/c/definitions.h index 3c2c8f4f4..c25d12577 100644 --- a/core/src/main/resources/org/teavm/backend/c/definitions.h +++ b/core/src/main/resources/org/teavm/backend/c/definitions.h @@ -26,6 +26,7 @@ #ifdef __GNUC__ #undef TEAVM_UNIX #define TEAVM_UNIX 1 + #include #endif #ifndef TEAVM_USE_SETJMP diff --git a/core/src/main/resources/org/teavm/backend/c/exceptions.h b/core/src/main/resources/org/teavm/backend/c/exceptions.h index 395e57e55..6e54a365f 100644 --- a/core/src/main/resources/org/teavm/backend/c/exceptions.h +++ b/core/src/main/resources/org/teavm/backend/c/exceptions.h @@ -1,6 +1,7 @@ #pragma once #include "definitions.h" #include +#include #if TEAVM_USE_SETJMP #include diff --git a/core/src/main/resources/org/teavm/backend/c/heaptrace.c b/core/src/main/resources/org/teavm/backend/c/heaptrace.c index d397091da..88e886ef6 100644 --- a/core/src/main/resources/org/teavm/backend/c/heaptrace.c +++ b/core/src/main/resources/org/teavm/backend/c/heaptrace.c @@ -1,6 +1,7 @@ #include "heaptrace.h" #include "core.h" #include "definitions.h" +#include "memory.h" #include #include #include diff --git a/core/src/main/resources/org/teavm/backend/c/memory.c b/core/src/main/resources/org/teavm/backend/c/memory.c index 25b0a2abc..65c0412ad 100644 --- a/core/src/main/resources/org/teavm/backend/c/memory.c +++ b/core/src/main/resources/org/teavm/backend/c/memory.c @@ -11,6 +11,10 @@ #include #endif +#if TEAVM_MEMORY_TRACE + #include "heaptrace.h" +#endif + void* teavm_gc_heapAddress = NULL; void* teavm_gc_gcStorageAddress = NULL; int32_t teavm_gc_gcStorageSize = INT32_C(0);