Files
FEX-Emu--FEX/Source/Windows/Common/CRT/Alloc.cpp
T
Martin Storsjö 08031a2767 Add missing includes
This fixes compilation with libc++ 23, which has removed a number
of unnecessary transitive includes in its headers.

Include <cstdlib> in StringConv.h for std::strtoll and std::strtoull.

Include <cstdlib> for the declarations of malloc/free/realloc/calloc
in Alloc.cpp. (Without this, the functions we define end up with
C++ name mangling.)

Include <stdarg.h> in IO.cpp for va_start/va_end.
2026-07-28 23:17:43 +03:00

32 lines
663 B
C++

// SPDX-License-Identifier: MIT
#define _SECIMP
#define _CRTIMP
#include <cstdint>
#include <cstdlib>
#include "../Priv.h"
#include <rpmalloc/rpmalloc.h>
void* calloc(size_t NumOfElements, size_t SizeOfElements) {
return ::rpcalloc(NumOfElements, SizeOfElements);
}
void free(void* Memory) {
::rpfree(Memory);
}
void* malloc(size_t Size) {
return ::rpmalloc(Size);
}
void* realloc(void* Memory, size_t NewSize) {
return ::rprealloc(Memory, NewSize);
}
DLLEXPORT_FUNC(void*, _aligned_malloc, (size_t Size, size_t Alignment)) {
return ::rpaligned_alloc(Alignment, Size);
}
DLLEXPORT_FUNC(void, _aligned_free, (void* Memory)) {
::rpfree(Memory);
}