fix(libs): fix libscelibcinternal crt symbol conflict, stray macro in pthread_once, missing typedefs, unnamed params
This commit is contained in:
parent
59bee8d187
commit
47099897ac
|
|
@ -26,6 +26,10 @@ foreach(LIB_DIR ${LIBS_DIRS})
|
|||
set(RPX_FILE ${CMAKE_CURRENT_BINARY_DIR}/libs/${LIB_NAME}.prx)
|
||||
set(STAMP_FILE ${CMAKE_CURRENT_BINARY_DIR}/libs/${LIB_NAME}.patched)
|
||||
|
||||
if(${LIB_NAME} STREQUAL "libSceLibcInternal")
|
||||
target_link_options(${LIB_NAME} PRIVATE -nostartfiles -Wl,--allow-multiple-definition)
|
||||
endif()
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${STAMP_FILE}
|
||||
COMMAND $<TARGET_FILE:nid_patcher> ${LIB_NAME} ${RPX_FILE}
|
||||
|
|
|
|||
|
|
@ -163,6 +163,11 @@ using PthreadRwlockattr = PthreadRwlockattrPrivate*;
|
|||
using PthreadCond = PthreadCondPrivate*;
|
||||
using PthreadCondattr = PthreadCondattrPrivate*;
|
||||
using PthreadKey = int;
|
||||
using pthread_entry_func_t = void* (*)(void*);
|
||||
using pthread_key_destructor_func_t = void (*)(void*);
|
||||
using thread_dtors_func_t = void (*)();
|
||||
using get_thread_atexit_count_func_t = int (*)(KernelModule);
|
||||
using thread_atexit_report_func_t = void (*)(KernelModule);
|
||||
|
||||
struct FileStat {
|
||||
std::uint32_t st_dev;
|
||||
|
|
|
|||
|
|
@ -1,40 +0,0 @@
|
|||
add_executable(nid_patcher
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/nid/src/Sha1.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/nid/src/NidCompute.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/nid/src/main.cpp
|
||||
)
|
||||
target_include_directories(nid_patcher PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/nid/include)
|
||||
target_compile_features(nid_patcher PRIVATE cxx_std_20)
|
||||
|
||||
file(GLOB LIBS_DIRS LIST_DIRECTORIES true ${CMAKE_CURRENT_SOURCE_DIR}/lib*)
|
||||
|
||||
set(PATCHED_STAMPS)
|
||||
|
||||
foreach(LIB_DIR ${LIBS_DIRS})
|
||||
if(IS_DIRECTORY ${LIB_DIR})
|
||||
get_filename_component(LIB_NAME ${LIB_DIR} NAME)
|
||||
|
||||
add_library(${LIB_NAME} SHARED EXCLUDE_FROM_ALL ${LIB_DIR}/Export.cpp)
|
||||
set_target_properties(${LIB_NAME} PROPERTIES
|
||||
PREFIX ""
|
||||
SUFFIX .rpx
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libs
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libs
|
||||
)
|
||||
|
||||
set(RPX_FILE ${CMAKE_CURRENT_BINARY_DIR}/libs/${LIB_NAME}.prx)
|
||||
set(STAMP_FILE ${CMAKE_CURRENT_BINARY_DIR}/libs/${LIB_NAME}.patched)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${STAMP_FILE}
|
||||
COMMAND $<TARGET_FILE:nid_patcher> ${LIB_NAME} ${RPX_FILE}
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${STAMP_FILE}
|
||||
DEPENDS nid_patcher ${LIB_NAME}
|
||||
COMMENT "Patching NIDs for ${LIB_NAME}"
|
||||
)
|
||||
|
||||
list(APPEND PATCHED_STAMPS ${STAMP_FILE})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
add_custom_target(libs DEPENDS ${PATCHED_STAMPS})
|
||||
|
|
@ -2,6 +2,13 @@
|
|||
#include <cstddef>
|
||||
#include "SceTypes.hpp"
|
||||
|
||||
extern "C" int __stdcall DllMainCRTStartup(void* hinstDLL, unsigned long fdwReason, void* lpReserved) {
|
||||
(void)hinstDLL;
|
||||
(void)fdwReason;
|
||||
(void)lpReserved;
|
||||
return 1;
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
[[noreturn]] void abort(uint64_t arg0, uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t arg4, uint64_t arg5) {
|
||||
|
|
|
|||
|
|
@ -15,11 +15,12 @@ int sceSystemGestureClose(int32_t gesture_handle) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sceSystemGestureCreateTouchRecognizer(int32_t gesture_handle, SystemGestureTouchRecognizer* recognizer, int32_t, const SystemGestureRectangle*, const void*) {
|
||||
int sceSystemGestureCreateTouchRecognizer(int32_t gesture_handle, SystemGestureTouchRecognizer* recognizer, int32_t type, const SystemGestureRectangle* rectangle, const void* param) {
|
||||
(void)gesture_handle;
|
||||
(void)recognizer;
|
||||
(void)int32_t;
|
||||
(void)SystemGestureRectangle;
|
||||
(void)type;
|
||||
(void)rectangle;
|
||||
(void)param;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -27,16 +28,16 @@ int sceSystemGestureFinalizePrimitiveTouchRecognizer(void) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sceSystemGestureGetPrimitiveTouchEventByIndex(int32_t gesture_handle, uint32_t, SystemGesturePrimitiveTouchEvent* event) {
|
||||
int sceSystemGestureGetPrimitiveTouchEventByIndex(int32_t gesture_handle, uint32_t index, SystemGesturePrimitiveTouchEvent* event) {
|
||||
(void)gesture_handle;
|
||||
(void)uint32_t;
|
||||
(void)index;
|
||||
(void)event;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceSystemGestureGetPrimitiveTouchEventByPrimitiveID(int32_t gesture_handle, uint16_t, SystemGesturePrimitiveTouchEvent* event) {
|
||||
int sceSystemGestureGetPrimitiveTouchEventByPrimitiveID(int32_t gesture_handle, uint16_t primitiveId, SystemGesturePrimitiveTouchEvent* event) {
|
||||
(void)gesture_handle;
|
||||
(void)uint16_t;
|
||||
(void)primitiveId;
|
||||
(void)event;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -54,18 +55,18 @@ int sceSystemGestureGetPrimitiveTouchEventsCount(int32_t gesture_handle) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sceSystemGestureGetTouchEventByEventID(int32_t gesture_handle, const SystemGestureTouchRecognizer* recognizer, uint32_t, SystemGestureTouchEvent* event) {
|
||||
int sceSystemGestureGetTouchEventByEventID(int32_t gesture_handle, const SystemGestureTouchRecognizer* recognizer, uint32_t eventId, SystemGestureTouchEvent* event) {
|
||||
(void)gesture_handle;
|
||||
(void)recognizer;
|
||||
(void)uint32_t;
|
||||
(void)eventId;
|
||||
(void)event;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceSystemGestureGetTouchEventByIndex(int32_t gesture_handle, const SystemGestureTouchRecognizer* recognizer, uint32_t, SystemGestureTouchEvent* event) {
|
||||
int sceSystemGestureGetTouchEventByIndex(int32_t gesture_handle, const SystemGestureTouchRecognizer* recognizer, uint32_t index, SystemGestureTouchEvent* event) {
|
||||
(void)gesture_handle;
|
||||
(void)recognizer;
|
||||
(void)uint32_t;
|
||||
(void)index;
|
||||
(void)event;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -92,12 +93,14 @@ int sceSystemGestureGetTouchRecognizerInformation(int32_t gesture_handle, const
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sceSystemGestureInitializePrimitiveTouchRecognizer(const void*) {
|
||||
int sceSystemGestureInitializePrimitiveTouchRecognizer(const void* param) {
|
||||
(void)param;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t sceSystemGestureOpen(int32_t input_type, const void*) {
|
||||
int32_t sceSystemGestureOpen(int32_t input_type, const void* param) {
|
||||
(void)input_type;
|
||||
(void)param;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -123,8 +126,9 @@ int sceSystemGestureUpdateAllTouchRecognizer(int32_t gesture_handle) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int sceSystemGestureUpdatePrimitiveTouchRecognizer(int32_t gesture_handle, const void*) {
|
||||
int sceSystemGestureUpdatePrimitiveTouchRecognizer(int32_t gesture_handle, const void* param) {
|
||||
(void)gesture_handle;
|
||||
(void)param;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ int pthread_mutexattr_settype(PthreadMutexattr* attr, int type) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pthread_once(void* once_control, void(KYTY_SYSV_ABI* init_routine)()) {
|
||||
int pthread_once(void* once_control, void (*init_routine)()) {
|
||||
(void)once_control;
|
||||
(void)init_routine;
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ int pthread_mutexattr_settype(PthreadMutexattr* attr, int type) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pthread_once(void* once_control, void(KYTY_SYSV_ABI* init_routine)()) {
|
||||
int pthread_once(void* once_control, void (*init_routine)()) {
|
||||
(void)once_control;
|
||||
(void)init_routine;
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -406,7 +406,7 @@ int pthread_mutexattr_settype(PthreadMutexattr* attr, int type) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int pthread_once(void* once_control, void(KYTY_SYSV_ABI* init_routine)()) {
|
||||
int pthread_once(void* once_control, void (*init_routine)()) {
|
||||
(void)once_control;
|
||||
(void)init_routine;
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue