mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-14 10:48:28 +12:00
Initial macOS port bringup (#52)
This commit is contained in:
parent
a2abffd37b
commit
974edaa649
84 changed files with 157 additions and 122 deletions
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "Fiber.h"
|
||||
#if BOOST_OS_LINUX
|
||||
#if BOOST_OS_LINUX || BOOST_OS_MACOS
|
||||
#define _XOPEN_SOURCE
|
||||
#include <ucontext.h>
|
||||
|
||||
thread_local Fiber* sCurrentFiber{};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "util/MemMapper/MemMapper.h"
|
||||
|
||||
#if BOOST_OS_LINUX > 0
|
||||
#if BOOST_OS_LINUX || BOOST_OS_MACOS
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "util/MemMapper/MemMapper.h"
|
||||
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
|
||||
#include <Windows.h>
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ std::string_view& trim(std::string_view& str, const std::string& chars)
|
|||
return ltrim(rtrim(str, chars), chars);
|
||||
}
|
||||
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
|
||||
std::wstring GetSystemErrorMessageW()
|
||||
{
|
||||
|
@ -120,7 +120,7 @@ std::string GetSystemErrorMessage(const std::error_code& ec)
|
|||
return fmt::format("{}\n{}",msg, ec.message());
|
||||
}
|
||||
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
const DWORD MS_VC_EXCEPTION = 0x406D1388;
|
||||
#pragma pack(push,8)
|
||||
typedef struct tagTHREADNAME_INFO
|
||||
|
@ -135,7 +135,7 @@ typedef struct tagTHREADNAME_INFO
|
|||
|
||||
void SetThreadName(const char* name)
|
||||
{
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
|
||||
#ifndef _PUBLIC_RELEASE
|
||||
THREADNAME_INFO info;
|
||||
|
@ -154,12 +154,14 @@ void SetThreadName(const char* name)
|
|||
|
||||
#endif
|
||||
|
||||
#elif BOOST_OS_MACOS
|
||||
pthread_setname_np(name);
|
||||
#else
|
||||
pthread_setname_np(pthread_self(), name);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
std::pair<DWORD, DWORD> GetWindowsVersion()
|
||||
{
|
||||
using RtlGetVersion_t = LONG(*)(POSVERSIONINFOEXW);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "util/math/vector3.h"
|
||||
|
||||
#ifdef __clang__
|
||||
#include "Common/linux/fast_float.h"
|
||||
#include "Common/unix/fast_float.h"
|
||||
#endif
|
||||
|
||||
template <typename TType>
|
||||
|
|
|
@ -60,7 +60,7 @@ void libusbWrapper::init()
|
|||
|
||||
libusbWrapper::~libusbWrapper()
|
||||
{
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
// destroy default context
|
||||
if(p_libusb_exit)
|
||||
p_libusb_exit(nullptr);
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
|
||||
|
||||
private:
|
||||
#if BOOST_OS_WINDOWS > 0
|
||||
#if BOOST_OS_WINDOWS
|
||||
HMODULE m_module = nullptr;
|
||||
bool m_isInitialized = false;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue