diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index 66340b747..ec800589a 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -99,6 +99,14 @@ if (COMPILE_FFMPEG) import_ffmpeg_library(swscale) import_ffmpeg_library(swresample) import_ffmpeg_library(postproc) + add_library(3rdparty_ffmpeg INTERFACE) + target_link_libraries(3rdparty_ffmpeg INTERFACE + ffmpeg::avformat + ffmpeg::avcodec + ffmpeg::swscale + ffmpeg::avutil + ffmpeg::avfilter + ffmpeg::swresample) endif() # Dummy target to use when lib isn't available diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake index e7a9fb3ab..6560abacd 100644 --- a/cmake/ConfigureCompiler.cmake +++ b/cmake/ConfigureCompiler.cmake @@ -121,7 +121,8 @@ else() endif() # Specify C++ library to use as standard C++ when using clang (not required on linux due to GNU) - if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND (APPLE OR WIN32)) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND (APPLE OR WIN32) AND NOT CMAKE_CROSSCOMPILING) add_compile_options(-stdlib=libc++) endif() + add_compile_options(-municode) endif() diff --git a/kernel/cellos/CMakeLists.txt b/kernel/cellos/CMakeLists.txt index 5fb9c1a24..2e63c4211 100644 --- a/kernel/cellos/CMakeLists.txt +++ b/kernel/cellos/CMakeLists.txt @@ -60,6 +60,7 @@ PRIVATE ) target_link_libraries(cellos-kernel PUBLIC + kernel rpcs3_core # FIXME: remove 3rdparty::soundtouch # FIXME: remove 3rdparty::flatbuffers # FIXME: remove @@ -68,3 +69,7 @@ target_link_libraries(cellos-kernel PUBLIC 3rdparty::libusb # FIXME: remove 3rdparty::rtmidi # FIXME: remove ) + +if (WIN32 AND NOT MSVC) + target_compile_options(cellos-kernel PUBLIC -municode) +endif() diff --git a/kernel/cellos/include/cellos/sys_net/lv2_socket.h b/kernel/cellos/include/cellos/sys_net/lv2_socket.h index 7b7866c2c..d0417c33e 100644 --- a/kernel/cellos/include/cellos/sys_net/lv2_socket.h +++ b/kernel/cellos/include/cellos/sys_net/lv2_socket.h @@ -11,7 +11,7 @@ #include "util/mutex.h" #ifdef _WIN32 -#include +#include #include #else #ifdef __clang__ diff --git a/kernel/cellos/include/cellos/sys_net/lv2_socket_native.h b/kernel/cellos/include/cellos/sys_net/lv2_socket_native.h index f8d7d0509..9c706b8dc 100644 --- a/kernel/cellos/include/cellos/sys_net/lv2_socket_native.h +++ b/kernel/cellos/include/cellos/sys_net/lv2_socket_native.h @@ -2,7 +2,7 @@ #pragma once #ifdef _WIN32 -#include +#include #include #else #ifdef __clang__ diff --git a/kernel/cellos/include/cellos/sys_net/lv2_socket_p2ps.h b/kernel/cellos/include/cellos/sys_net/lv2_socket_p2ps.h index d156f6aca..8d90187f2 100644 --- a/kernel/cellos/include/cellos/sys_net/lv2_socket_p2ps.h +++ b/kernel/cellos/include/cellos/sys_net/lv2_socket_p2ps.h @@ -2,7 +2,7 @@ #include #ifdef _WIN32 -#include +#include #include #else #ifdef __clang__ diff --git a/kernel/cellos/include/cellos/sys_net/nt_p2p_port.h b/kernel/cellos/include/cellos/sys_net/nt_p2p_port.h index a723c4ef7..ab9705d53 100644 --- a/kernel/cellos/include/cellos/sys_net/nt_p2p_port.h +++ b/kernel/cellos/include/cellos/sys_net/nt_p2p_port.h @@ -5,7 +5,7 @@ #include "lv2_socket_p2ps.h" #ifdef _WIN32 -#include +#include #include #else #ifdef __clang__ diff --git a/kernel/cellos/include/cellos/sys_net/sys_net_helpers.h b/kernel/cellos/include/cellos/sys_net/sys_net_helpers.h index 7a09f1f22..0456dd3a6 100644 --- a/kernel/cellos/include/cellos/sys_net/sys_net_helpers.h +++ b/kernel/cellos/include/cellos/sys_net/sys_net_helpers.h @@ -1,7 +1,7 @@ #pragma once #ifdef _WIN32 -#include +#include #include #else #ifdef __clang__ diff --git a/kernel/cellos/src/sys_net.cpp b/kernel/cellos/src/sys_net.cpp index 3b9ba06a1..7cc6746dd 100644 --- a/kernel/cellos/src/sys_net.cpp +++ b/kernel/cellos/src/sys_net.cpp @@ -9,7 +9,7 @@ #include "sys_sync.h" #ifdef _WIN32 -#include +#include #include #else #ifdef __clang__ diff --git a/kernel/cellos/src/sys_ss.cpp b/kernel/cellos/src/sys_ss.cpp index 75e0d9951..d38b05be5 100644 --- a/kernel/cellos/src/sys_ss.cpp +++ b/kernel/cellos/src/sys_ss.cpp @@ -13,8 +13,8 @@ #include #ifdef _WIN32 -#include #include +#include //Must be included after windows.h for mingw #endif struct lv2_update_manager { diff --git a/kernel/cellos/src/sys_time.cpp b/kernel/cellos/src/sys_time.cpp index 20d66046c..03722eba8 100644 --- a/kernel/cellos/src/sys_time.cpp +++ b/kernel/cellos/src/sys_time.cpp @@ -359,7 +359,7 @@ error_code sys_time_get_current_time(vm::ptr sec, vm::ptr nsec) { // Get time difference in nanoseconds (using 128 bit accumulator) const u64 diff_sl = diff_base * 1000000000ull; const u64 diff_sh = rx::umulh64(diff_base, 1000000000ull); - const u64 diff = utils::udiv128(diff_sh, diff_sl, s_time_aux_info.perf_freq); + const u64 diff = rx::udiv128(diff_sh, diff_sl, s_time_aux_info.perf_freq); // get time since Epoch in nanoseconds const u64 time = s_time_aux_info.start_ftime * 100u + diff --git a/rpcs3/Emu/GDB.cpp b/rpcs3/Emu/GDB.cpp index a4c080821..2715f0439 100644 --- a/rpcs3/Emu/GDB.cpp +++ b/rpcs3/Emu/GDB.cpp @@ -13,7 +13,7 @@ #ifdef _WIN32 #include -#include +#include #include // sockaddr_un #else #ifdef __clang__ diff --git a/rpcs3/Emu/NP/ip_address.h b/rpcs3/Emu/NP/ip_address.h index dd70a9bda..5fa7e22f8 100644 --- a/rpcs3/Emu/NP/ip_address.h +++ b/rpcs3/Emu/NP/ip_address.h @@ -10,7 +10,7 @@ #ifdef _WIN32 #include -#include +#include #else #ifdef __clang__ #pragma GCC diagnostic push diff --git a/rpcs3/Emu/NP/np_dnshook.cpp b/rpcs3/Emu/NP/np_dnshook.cpp index 3969d4406..9469a3868 100644 --- a/rpcs3/Emu/NP/np_dnshook.cpp +++ b/rpcs3/Emu/NP/np_dnshook.cpp @@ -8,7 +8,7 @@ #include #ifdef _WIN32 -#include +#include #else #ifdef __clang__ #pragma GCC diagnostic push diff --git a/rpcs3/Emu/NP/np_handler.cpp b/rpcs3/Emu/NP/np_handler.cpp index 867421784..eba2698fe 100644 --- a/rpcs3/Emu/NP/np_handler.cpp +++ b/rpcs3/Emu/NP/np_handler.cpp @@ -19,7 +19,7 @@ #ifdef _WIN32 #include -#include +#include #include #else #ifdef __clang__ diff --git a/rpcs3/Emu/NP/np_helpers.cpp b/rpcs3/Emu/NP/np_helpers.cpp index 579c3976b..078cae2df 100644 --- a/rpcs3/Emu/NP/np_helpers.cpp +++ b/rpcs3/Emu/NP/np_helpers.cpp @@ -4,7 +4,7 @@ #include "rpcn_client.h" #ifdef _WIN32 -#include +#include #endif namespace np diff --git a/rpcs3/Emu/NP/rpcn_client.cpp b/rpcs3/Emu/NP/rpcn_client.cpp index c2b367b92..7387a1038 100644 --- a/rpcs3/Emu/NP/rpcn_client.cpp +++ b/rpcs3/Emu/NP/rpcn_client.cpp @@ -20,7 +20,7 @@ #ifdef _WIN32 #include -#include +#include #else #ifdef __clang__ #pragma GCC diagnostic push diff --git a/rpcs3/Emu/NP/signaling_handler.cpp b/rpcs3/Emu/NP/signaling_handler.cpp index b4b73846f..fbe7c3592 100644 --- a/rpcs3/Emu/NP/signaling_handler.cpp +++ b/rpcs3/Emu/NP/signaling_handler.cpp @@ -4,7 +4,6 @@ #include "signaling_handler.h" #include "Emu/IdManager.h" #include "rpcsx/fw/ps3/cellSysutil.h" -#include "np_handler.h" #include "Emu/NP/vport0.h" #include "Emu/NP/np_helpers.h" diff --git a/rpcs3/util/Thread.cpp b/rpcs3/util/Thread.cpp index b9c909bbb..9b4d11729 100644 --- a/rpcs3/util/Thread.cpp +++ b/rpcs3/util/Thread.cpp @@ -19,7 +19,7 @@ #ifdef _WIN32 #include -#include +#include #include #include @@ -1494,7 +1494,7 @@ bool handle_access_violation(u32 addr, bool is_writing, ucontext_t* context) noe { if (auto mem = vm::get(vm::any, addr)) { - reader_lock lock(pf_entries.mutex); + ::reader_lock lock(pf_entries.mutex); for (const auto& entry : pf_entries.entries) { diff --git a/rpcs3/util/logs.cpp b/rpcs3/util/logs.cpp index c7b1e874a..465bec6ed 100644 --- a/rpcs3/util/logs.cpp +++ b/rpcs3/util/logs.cpp @@ -489,7 +489,7 @@ logs::file_writer::file_writer(const std::string& name, u64 max_size) #ifdef _WIN32 // Autodelete compressed log file FILE_DISPOSITION_INFO disp{}; - disp.DeleteFileW = true; + disp.DeleteFile = true; SetFileInformationByHandle(m_fout2.get_handle(), FileDispositionInfo, &disp, sizeof(disp)); #endif @@ -558,7 +558,7 @@ logs::file_writer::~file_writer() #ifdef _WIN32 // Cancel compressed log file auto-deletion FILE_DISPOSITION_INFO disp; - disp.DeleteFileW = false; + disp.DeleteFile = false; SetFileInformationByHandle(m_fout2.get_handle(), FileDispositionInfo, &disp, sizeof(disp)); #else // Restore compressed log file permissions @@ -744,7 +744,7 @@ void logs::file_writer::close_prematurely() #ifdef _WIN32 // Cancel compressed log file auto-deletion FILE_DISPOSITION_INFO disp; - disp.DeleteFileW = false; + disp.DeleteFile = false; SetFileInformationByHandle(m_fout2.get_handle(), FileDispositionInfo, &disp, sizeof(disp)); #else // Restore compressed log file permissions diff --git a/rpcs3/util/stack_trace.cpp b/rpcs3/util/stack_trace.cpp index 9464e68bf..7dfdebbb3 100644 --- a/rpcs3/util/stack_trace.cpp +++ b/rpcs3/util/stack_trace.cpp @@ -5,7 +5,7 @@ #define WIN32_LEAN_AND_MEAN #include #define DBGHELP_TRANSLATE_TCHAR -#include +#include #include #else #include