diff --git a/src/core/libraries/libc_internal/libc_internal.cpp b/src/core/libraries/libc_internal/libc_internal.cpp index e140c225..014fa7a2 100644 --- a/src/core/libraries/libc_internal/libc_internal.cpp +++ b/src/core/libraries/libc_internal/libc_internal.cpp @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later -// Generated By moduleGenerator +#include #include "common/logging/log.h" #include "core/libraries/error_codes.h" #include "core/libraries/libs.h" @@ -17,12 +17,22 @@ void* PS4_SYSV_ABI internal_memcpy(void* dest, const void* src, size_t n) { return std::memcpy(dest, src, n); } -errno_t PS4_SYSV_ABI internal_memcpy_s(void* dest, rsize_t destsz, const void* src, rsize_t count) { +int PS4_SYSV_ABI internal_memcpy_s(void* dest, rsize_t destsz, const void* src, rsize_t count) { +#ifdef _WIN64 return memcpy_s(dest, destsz, src, count); +#else + std::memcpy(dest, destsz, src, count); + return 0; // ALL OK +#endif } -errno_t PS4_SYSV_ABI internal_strcpy_s(char* dest, rsize_t dest_size, const char* src) { +int PS4_SYSV_ABI internal_strcpy_s(char* dest, rsize_t dest_size, const char* src) { +#ifdef _WIN64 return strcpy_s(dest, dest_size, src); +#else + std::strcpy(dest, src); + return 0; // ALL OK +#endif } int PS4_SYSV_ABI internal_memcmp(const void* s1, const void* s2, size_t n) { @@ -30,7 +40,7 @@ int PS4_SYSV_ABI internal_memcmp(const void* s1, const void* s2, size_t n) { } float PS4_SYSV_ABI internal_expf(float x) { - return std::expf(x); + return expf(x); } void RegisterlibSceLibcInternal(Core::Loader::SymbolsResolver* sym) { diff --git a/src/core/libraries/libc_internal/libc_internal.h b/src/core/libraries/libc_internal/libc_internal.h index d24bc500..e154eff6 100644 --- a/src/core/libraries/libc_internal/libc_internal.h +++ b/src/core/libraries/libc_internal/libc_internal.h @@ -12,8 +12,8 @@ class SymbolsResolver; namespace Libraries::LibcInternal { void* PS4_SYSV_ABI internal_memset(void* s, int c, size_t n); void* PS4_SYSV_ABI internal_memcpy(void* dest, const void* src, size_t n); -errno_t PS4_SYSV_ABI internal_memcpy_s(void* dest, rsize_t destsz, const void* src, rsize_t count); -errno_t PS4_SYSV_ABI internal_strcpy_s(char* dest, rsize_t dest_size, const char* src); +int PS4_SYSV_ABI internal_memcpy_s(void* dest, rsize_t destsz, const void* src, rsize_t count); +int PS4_SYSV_ABI internal_strcpy_s(char* dest, rsize_t dest_size, const char* src); int PS4_SYSV_ABI internal_memcmp(const void* s1, const void* s2, size_t n); float PS4_SYSV_ABI internal_expf(float x);