Skip to content

Commit f5e1f6c

Browse files
committed
CMake, SDL2: remove unnesesary SDL.h includes
1 parent 2e06299 commit f5e1f6c

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

src/Common/PlatformLinux.inl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ inline pthread_t GetCurrentThreadId()
8282
return pthread_self();
8383
}
8484

85+
inline void Sleep(int ms)
86+
{
87+
usleep(ms * 1000);
88+
}
89+
8590
inline void _splitpath (
8691
const char* path, // Path Input
8792
char* drive, // Drive : Output
@@ -230,6 +235,10 @@ typedef dirent DirEntryType;
230235
#define O_SEQUENTIAL 0
231236
#define SH_DENYWR 0
232237

238+
239+
#define itoa SDL_itoa
240+
#define _itoa_s SDL_itoa
241+
233242
#define _stricmp stricmp
234243
#define strcmpi stricmp
235244
#define lstrcpy strcpy

src/utils/xrLCUtil/xrThread.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "pch.hpp"
22
#include "xrThread.hpp"
3-
#include "SDL.h"
43

54
void CThread::StubLog(const char*, ...) {}
65
void CThread::startup(void* P)
@@ -31,7 +30,7 @@ void CThreadManager::wait(u32 sleep_time)
3130
return;
3231
for (;;)
3332
{
34-
SDL_Delay(sleep_time);
33+
Sleep(sleep_time);
3534

3635
perf[0] = 0;
3736
float sumProgress = 0;

src/xrCore/FS.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#endif
1414
#include <sys/stat.h>
1515
#include <fcntl.h>
16-
#include "SDL.h"
1716

1817
#pragma warning(pop)
1918

@@ -122,7 +121,7 @@ bool file_handle_internal(LPCSTR file_name, u32& size, int& file_handle)
122121
{
123122
if (open_internal(file_name, file_handle))
124123
{
125-
SDL_Delay(1);
124+
Sleep(1);
126125
if (open_internal(file_name, file_handle))
127126
return (false);
128127
}

src/xrCore/_std_extensions.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <float.h>
77
#include <stdio.h>
88
#include "xrCommon/math_funcs_inline.h"
9-
#include "SDL.h"
109
//#include "xr_token.h"
1110

1211
#ifdef abs
@@ -258,17 +257,6 @@ inline int xr_strcat(char(&destination)[count], LPCSTR source)
258257
}
259258
//#endif // #ifndef _EDITOR
260259

261-
#if defined(LINUX)
262-
263-
#define itoa SDL_itoa
264-
#define _itoa_s(value, buffer, radix) SDL_itoa(value, buffer, radix)
265-
266-
inline void Sleep(int ms)
267-
{
268-
SDL_Delay(ms);
269-
}
270-
#endif
271-
272260
inline void MemFill32(void* dst, u32 value, size_t dstSize)
273261
{
274262
u32* ptr = static_cast<u32*>(dst);

src/xrScriptEngine/script_lua_helper.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#include "pch.hpp"
22
#include "script_lua_helper.hpp"
33
#include "script_debugger.hpp"
4+
#if defined(LINUX)
5+
#include "SDL.h" // for xr_itoa
6+
#endif
47

58
CDbgLuaHelper* CDbgLuaHelper::m_pThis = nullptr;
69
lua_State* CDbgLuaHelper::L = nullptr;

0 commit comments

Comments
 (0)