Skip to content

Commit

Permalink
Patches for Clang 9 build
Browse files Browse the repository at this point in the history
  • Loading branch information
TellowKrinkle committed Nov 22, 2021
1 parent 10ce461 commit 94d132d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
6 changes: 5 additions & 1 deletion cmake/BuildParameters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,11 @@ endif()
# MacOS-specific things
#-------------------------------------------------------------------------------

set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
if (APPLE AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 10)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) # Compiler needs 3rd party option header anyways
else()
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
endif()

if (APPLE AND ${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.14 AND NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 9)
# Older versions of the macOS stdlib don't have operator new(size_t, align_val_t)
Expand Down
10 changes: 5 additions & 5 deletions pcsx2/DEV9/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void NetRxThread()
{
while (rx_fifo_can_rx() && nif->recv(&tmp))
{
std::lock_guard rx_lock(rx_mutex);
std::lock_guard<std::mutex> rx_lock(rx_mutex);
//Check if we can still rx
if (rx_fifo_can_rx())
rx_process(&tmp);
Expand Down Expand Up @@ -213,7 +213,7 @@ NetAdapter::~NetAdapter()
internalRxThreadRunning.store(false);

{
std::lock_guard srvlock(internalRxMutex);
std::lock_guard<std::mutex> srvlock(internalRxMutex);
internalRxHasData = true;
}

Expand Down Expand Up @@ -423,7 +423,7 @@ void NetAdapter::InternalSignalReceived()
if (internalRxThreadRunning.load())
{
{
std::lock_guard srvlock(internalRxMutex);
std::lock_guard<std::mutex> srvlock(internalRxMutex);
internalRxHasData = true;
}

Expand All @@ -436,11 +436,11 @@ void NetAdapter::InternalServerThread()
NetPacket tmp;
while (internalRxThreadRunning.load())
{
std::unique_lock srvLock(internalRxMutex);
std::unique_lock<std::mutex> srvLock(internalRxMutex);
internalRxCV.wait(srvLock, [&] { return internalRxHasData; });

{
std::lock_guard rx_lock(rx_mutex);
std::lock_guard<std::mutex> rx_lock(rx_mutex);
while (rx_fifo_can_rx() && InternalServerRecv(&tmp))
rx_process(&tmp);
}
Expand Down
4 changes: 2 additions & 2 deletions pcsx2/GS/GS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ void GSsetExclusive(int enabled)
#ifndef PCSX2_CORE
void GSResizeWindow(int width, int height)
{
std::unique_lock lock(s_gs_window_resized_lock);
std::unique_lock<std::mutex> lock(s_gs_window_resized_lock);
s_new_gs_window_width = width;
s_new_gs_window_height = height;
s_gs_window_resized.store(true);
Expand All @@ -699,7 +699,7 @@ bool GSCheckForWindowResize(int* new_width, int* new_height)
if (!s_gs_window_resized.load())
return false;

std::unique_lock lock(s_gs_window_resized_lock);
std::unique_lock<std::mutex> lock(s_gs_window_resized_lock);
*new_width = s_new_gs_window_width;
*new_height = s_new_gs_window_height;
s_gs_window_resized.store(false);
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/GS/GSLocalMemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ void GSLocalMemory::ReadImageX(int& tx, int& ty, u8* dst, int len, GIFRegBITBLTB

len /= 4;

GSOffset::PAPtrHelper pa = off.assertSizesMatch(swizzle32).paMulti(m_vm32, 0, y);
GSOffset::PAPtrHelper<u32> pa = off.assertSizesMatch(swizzle32).paMulti(m_vm32, 0, y);

while (len > 0)
{
Expand Down
2 changes: 1 addition & 1 deletion pcsx2/GS/GSLocalMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class GSOffset : GSSwizzleInfo
template <typename VM>
PAPtrHelper<VM> paMulti(VM* vm, int x, int y) const
{
return PAPtrHelper(*this, vm, x, y);
return PAPtrHelper<VM>(*this, vm, x, y);
}

/// Loop over the pixels in the given rectangle
Expand Down
6 changes: 3 additions & 3 deletions pcsx2/MemoryCardFolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1703,7 +1703,7 @@ std::vector<FolderMemoryCard::EnumeratedFileEntry> FolderMemoryCard::GetOrderedF
wxDateTime creationTime, modificationTime;
fileInfo.GetTimes(nullptr, &modificationTime, &creationTime);

const wxCharTypeBuffer fileNameUTF8(fileName.ToUTF8());
const wxCharTypeBuffer<char> fileNameUTF8(fileName.ToUTF8());
const YAML::Node& node = index[fileNameUTF8.data()];

// orderForLegacyFiles will decrement even if it ends up being unused, but that's fine
Expand Down Expand Up @@ -1750,7 +1750,7 @@ void FolderMemoryCard::DeleteFromIndex(const wxString& filePath, const wxString&

YAML::Node index = LoadYAMLFromFile(indexName);

const wxCharTypeBuffer entryUTF8(entry.ToUTF8());
const wxCharTypeBuffer<char> entryUTF8(entry.ToUTF8());
index.remove(entryUTF8.data());

// Write out the changes
Expand Down Expand Up @@ -1916,7 +1916,7 @@ void FileAccessHelper::WriteIndex(wxFileName folderName, MemoryCardFileEntry* co
folderName.SetName(wxString::FromAscii(cleanName));
}

const wxCharTypeBuffer fileName(folderName.GetName().ToUTF8());
const wxCharTypeBuffer<char> fileName(folderName.GetName().ToUTF8());
folderName.SetName(L"_pcsx2_index");

YAML::Node index = LoadYAMLFromFile(folderName.GetFullPath());
Expand Down

0 comments on commit 94d132d

Please sign in to comment.