2023-10-06 11:19:09 +00:00
|
|
|
#include "libc.h"
|
|
|
|
|
2023-10-06 13:05:34 +00:00
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
#include <cstring>
|
|
|
|
|
2023-10-06 11:19:09 +00:00
|
|
|
namespace Emulator::HLE::Libraries::LibC {
|
|
|
|
|
|
|
|
PS4_SYSV_ABI int printf(VA_ARGS) {
|
|
|
|
VA_CTX(ctx);
|
|
|
|
return printf_ctx(&ctx);
|
|
|
|
}
|
2023-10-06 13:05:34 +00:00
|
|
|
|
|
|
|
PS4_SYSV_ABI void exit(int code) { std::exit(code); }
|
|
|
|
|
|
|
|
PS4_SYSV_ABI int atexit(void (*func)()) {
|
|
|
|
int rt = std::atexit(func);
|
|
|
|
if (rt != 0) {
|
|
|
|
BREAKPOINT();
|
|
|
|
}
|
|
|
|
return rt;
|
|
|
|
}
|
|
|
|
|
|
|
|
int PS4_SYSV_ABI memcmp(const void* s1, const void* s2, size_t n) { return std::memcmp(s1, s2, n); }
|
|
|
|
|
|
|
|
void* PS4_SYSV_ABI memcpy(void* dest, const void* src, size_t n) { return std::memcpy(dest, src, n); }
|
|
|
|
|
2023-10-06 18:49:53 +00:00
|
|
|
void* PS4_SYSV_ABI memset(void* s, int c, size_t n) { return std::memset(s, c, n); }
|
|
|
|
|
2023-10-06 11:19:09 +00:00
|
|
|
}; // namespace Emulator::HLE::Libraries::LibC
|