mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Merge pull request #2953 from lioncash/macro
CommonFuncs: Remove SLEEP macro
This commit is contained in:
commit
39ab0ebbd3
@ -4,13 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
#define SLEEP(x) Sleep(x)
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#define SLEEP(x) usleep(x*1000)
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <libkern/OSByteOrder.h>
|
||||
#endif
|
||||
|
@ -74,7 +74,8 @@ void GeckoSockServer::GeckoConnectionWaiter()
|
||||
|
||||
new_client = std::make_unique<sf::TcpSocket>();
|
||||
}
|
||||
SLEEP(1);
|
||||
|
||||
Common::SleepCurrentThread(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/Thread.h"
|
||||
|
||||
#include "Core/HW/WiimoteReal/WiimoteReal.h"
|
||||
|
||||
@ -250,7 +251,7 @@ void WiimoteScanner::Update()
|
||||
// Some hacks that allows disconnects to be detected before connections are handled
|
||||
// workaround for Wiimote 1 moving to slot 2 on temporary disconnect
|
||||
if (forgot_some)
|
||||
SLEEP(100);
|
||||
Common::SleepCurrentThread(100);
|
||||
}
|
||||
|
||||
// Find and connect Wiimotes.
|
||||
@ -313,12 +314,8 @@ void WiimoteScanner::FindWiimotes(std::vector<Wiimote*> & found_wiimotes, Wiimot
|
||||
}
|
||||
|
||||
SetupDiDestroyDeviceInfoList(device_info);
|
||||
|
||||
// Don't mind me, just a random sleep to fix stuff on Windows
|
||||
//if (!wiimotes.empty())
|
||||
// SLEEP(2000);
|
||||
|
||||
}
|
||||
|
||||
int CheckDeviceType_Write(HANDLE &dev_handle, const u8* buf, size_t size, int attempts)
|
||||
{
|
||||
OVERLAPPED hid_overlap_write = OVERLAPPED();
|
||||
|
@ -359,7 +359,7 @@ bool Wiimote::PrepareOnThread()
|
||||
|
||||
return (IOWrite(mode_report, sizeof(mode_report)) &&
|
||||
IOWrite(led_report, sizeof(led_report)) &&
|
||||
(SLEEP(200), IOWrite(rumble_report, sizeof(rumble_report))) &&
|
||||
(Common::SleepCurrentThread(200), IOWrite(rumble_report, sizeof(rumble_report))) &&
|
||||
IOWrite(req_status_report, sizeof(req_status_report)));
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <cstring>
|
||||
#include <getopt.h>
|
||||
#include <string>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Event.h"
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/IniFile.h"
|
||||
#include "Common/Thread.h"
|
||||
|
||||
#include "VideoCommon/Debugger.h"
|
||||
#include "VideoCommon/NativeVertexFormat.h"
|
||||
@ -56,7 +57,7 @@ void GFXDebuggerCheckAndPause(bool update)
|
||||
while ( GFXDebuggerPauseFlag )
|
||||
{
|
||||
if (update) GFXDebuggerUpdateScreen();
|
||||
SLEEP(5);
|
||||
Common::SleepCurrentThread(5);
|
||||
}
|
||||
g_pdebugger->OnContinue();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user