mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-10 00:41:19 +12:00
Add all the files
This commit is contained in:
parent
e3db07a16a
commit
d60742f52b
1445 changed files with 430238 additions and 0 deletions
34
src/Common/windows/platform.cpp
Normal file
34
src/Common/windows/platform.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include <Windows.h>
|
||||
|
||||
SlimRWLock::SlimRWLock()
|
||||
{
|
||||
static_assert(sizeof(m_lock) == sizeof(SRWLOCK));
|
||||
RTL_SRWLOCK* srwLock = (RTL_SRWLOCK*)&m_lock;
|
||||
*srwLock = SRWLOCK_INIT;
|
||||
//m_lock = { SRWLOCK_INIT };
|
||||
}
|
||||
|
||||
void SlimRWLock::LockRead()
|
||||
{
|
||||
AcquireSRWLockShared((SRWLOCK*)&m_lock);
|
||||
}
|
||||
|
||||
void SlimRWLock::UnlockRead()
|
||||
{
|
||||
ReleaseSRWLockShared((SRWLOCK*)&m_lock);
|
||||
}
|
||||
|
||||
void SlimRWLock::LockWrite()
|
||||
{
|
||||
AcquireSRWLockExclusive((SRWLOCK*)&m_lock);
|
||||
}
|
||||
|
||||
void SlimRWLock::UnlockWrite()
|
||||
{
|
||||
ReleaseSRWLockExclusive((SRWLOCK*)&m_lock);
|
||||
}
|
||||
|
||||
uint32_t GetExceptionError()
|
||||
{
|
||||
return (uint32_t)GetLastError();
|
||||
}
|
28
src/Common/windows/platform.h
Normal file
28
src/Common/windows/platform.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <Windows.h>
|
||||
|
||||
#define AF_BLUETOOTH AF_BTH
|
||||
#define BTPROTO_RFCOMM BT_PORT_ANY
|
||||
|
||||
class SlimRWLock
|
||||
{
|
||||
public:
|
||||
SlimRWLock();
|
||||
|
||||
void LockRead();
|
||||
void UnlockRead();
|
||||
void LockWrite();
|
||||
void UnlockWrite();
|
||||
|
||||
private:
|
||||
/*SRWLOCK*/ void* m_lock;
|
||||
};
|
||||
|
||||
uint32_t GetExceptionError();
|
Loading…
Add table
Add a link
Reference in a new issue