ConfettiFX/The-Forge

missing file include creates incomplete DLL export for IMemory.h/MemoryTracking.c

vlmillet opened this issue · 0 comments

MemoryTracking.c is not including IMemory.h, and then do not have the declaration of the tf_*_internal* functions. They are then seen as first declaration and definition and miss the FORGE_API macro which could export them.
I tried to include IMemory.h then, but it triggers macro/compilation errors with the #define of tf_malloc.
Anyway i guess the solution would be to create a shared include file which only have these declarations:

#ifdef __cplusplus
extern "C"
{
#endif
	FORGE_API bool initMemAlloc(const char* appName);
	FORGE_API void exitMemAlloc(void);

	FORGE_API void* tf_malloc_internal(size_t size, const char* f, int l, const char* sf);
	FORGE_API void* tf_memalign_internal(size_t align, size_t size, const char* f, int l, const char* sf);
	FORGE_API void* tf_calloc_internal(size_t count, size_t size, const char* f, int l, const char* sf);
	FORGE_API void* tf_calloc_memalign_internal(size_t count, size_t align, size_t size, const char* f, int l, const char* sf);
	FORGE_API void* tf_realloc_internal(void* ptr, size_t size, const char* f, int l, const char* sf);
	FORGE_API void  tf_free_internal(void* ptr, const char* f, int l, const char* sf);

#ifdef __cplusplus
}    // extern "C"
#endif

and which would be included in MemoryTracking.c and IMemory.h