mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 12:00:17 +02:00
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.
32 lines
663 B
C++
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);
|
|
}
|