Initial macOS port bringup (#52)

This commit is contained in:
Marcin Chojnacki 2022-08-26 04:03:26 +02:00 committed by GitHub
parent a2abffd37b
commit 974edaa649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
84 changed files with 157 additions and 122 deletions

View file

@ -78,7 +78,7 @@ void CafeInit()
rpxPathStart = 0;
}
std::string_view rpxFileName = std::basic_string_view<char>(_pathToExecutable.data() + rpxPathStart, _pathToExecutable.data() + _pathToExecutable.size());
std::string_view rpxFileName(_pathToExecutable.data() + rpxPathStart, _pathToExecutable.size() - rpxPathStart);
argStorageIndex = 0;
_coreinitInfo->argc = 0;

View file

@ -424,7 +424,7 @@ typedef struct
static_assert(sizeof(UCParamStruct_t) == 0x54); // unsure
#if BOOST_OS_LINUX
#if BOOST_OS_LINUX || BOOST_OS_MACOS
#define _strcmpi strcasecmp
#endif

View file

@ -63,7 +63,8 @@ namespace coreinit
bool negativeAlignment = alignment < 0;
if (negativeAlignment)
alignment = -alignment;
if (!std::has_single_bit<uint32>((uint32)alignment))
uint32 bits = (uint32)alignment;
if (bits == 0 || (bits & (bits - 1)) != 0)
{
cemuLog_log(LogType::APIErrors, "MEMGetAllocatableSizeForFrmHeapEx(): Invalid alignment");
return 0;

View file

@ -455,7 +455,7 @@ void export_curl_multi_fdset(PPCInterpreter_t* hCPU)
ppcDefineParamMEMPTR(exceptionFd, wu_fd_set, 3);
ppcDefineParamU32BEPtr(maxFd, 4);
#if BOOST_OS_LINUX > 0
#if BOOST_OS_LINUX || BOOST_OS_MACOS
cemuLog_log(LogType::Force, "curl_multi_fdset(...) - todo");
osLib_returnFromFunction(hCPU, 0);

View file

@ -242,7 +242,7 @@ namespace save
}
catch (const std::exception& ex)
{
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
std::wstringstream errorMsg;
errorMsg << L"Couldn't move your save files!" << std::endl << std::endl;
errorMsg << L"Error: " << ex.what() << std::endl << std::endl;

View file

@ -3,7 +3,7 @@
#include <bitset>
#include "nsyshid.h"
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
#include <setupapi.h>
#include <initguid.h>

View file

@ -6,7 +6,7 @@
#include "Common/socket.h"
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
#define WU_AF_INET 2
@ -2085,7 +2085,7 @@ void nsysnet_load()
osLib_addFunction("nsysnet", "NSSLExportInternalClientCertificate", nsysnet::export_NSSLExportInternalClientCertificate);
}
#if BOOST_OS_LINUX
#if BOOST_OS_LINUX || BOOST_OS_MACOS
void nsysnet_notifyCloseSharedSocket(SOCKET existingSocket)
{

View file

@ -2,7 +2,7 @@
#include <set>
#include <vector>
#if BOOST_OS_WINDOWS > 0
#if BOOST_OS_WINDOWS
#include <WinSock2.h>
#else
#include <sys/socket.h>