Skip to content

Commit

Permalink
CMake, SDL2: remove unnesesary SDL.h includes
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Aug 8, 2018
1 parent 2e06299 commit f5e1f6c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
9 changes: 9 additions & 0 deletions src/Common/PlatformLinux.inl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ inline pthread_t GetCurrentThreadId()
return pthread_self();
}

inline void Sleep(int ms)
{
usleep(ms * 1000);
}

inline void _splitpath (
const char* path, // Path Input
char* drive, // Drive : Output
Expand Down Expand Up @@ -230,6 +235,10 @@ typedef dirent DirEntryType;
#define O_SEQUENTIAL 0
#define SH_DENYWR 0


#define itoa SDL_itoa
#define _itoa_s SDL_itoa

#define _stricmp stricmp
#define strcmpi stricmp
#define lstrcpy strcpy
Expand Down
3 changes: 1 addition & 2 deletions src/utils/xrLCUtil/xrThread.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "pch.hpp"
#include "xrThread.hpp"
#include "SDL.h"

void CThread::StubLog(const char*, ...) {}
void CThread::startup(void* P)
Expand Down Expand Up @@ -31,7 +30,7 @@ void CThreadManager::wait(u32 sleep_time)
return;
for (;;)
{
SDL_Delay(sleep_time);
Sleep(sleep_time);

perf[0] = 0;
float sumProgress = 0;
Expand Down
3 changes: 1 addition & 2 deletions src/xrCore/FS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#endif
#include <sys/stat.h>
#include <fcntl.h>
#include "SDL.h"

#pragma warning(pop)

Expand Down Expand Up @@ -122,7 +121,7 @@ bool file_handle_internal(LPCSTR file_name, u32& size, int& file_handle)
{
if (open_internal(file_name, file_handle))
{
SDL_Delay(1);
Sleep(1);
if (open_internal(file_name, file_handle))
return (false);
}
Expand Down
12 changes: 0 additions & 12 deletions src/xrCore/_std_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#include <float.h>
#include <stdio.h>
#include "xrCommon/math_funcs_inline.h"
#include "SDL.h"
//#include "xr_token.h"

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

#if defined(LINUX)

#define itoa SDL_itoa
#define _itoa_s(value, buffer, radix) SDL_itoa(value, buffer, radix)

inline void Sleep(int ms)
{
SDL_Delay(ms);
}
#endif

inline void MemFill32(void* dst, u32 value, size_t dstSize)
{
u32* ptr = static_cast<u32*>(dst);
Expand Down
3 changes: 3 additions & 0 deletions src/xrScriptEngine/script_lua_helper.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "pch.hpp"
#include "script_lua_helper.hpp"
#include "script_debugger.hpp"
#if defined(LINUX)
#include "SDL.h" // for xr_itoa
#endif

CDbgLuaHelper* CDbgLuaHelper::m_pThis = nullptr;
lua_State* CDbgLuaHelper::L = nullptr;
Expand Down

0 comments on commit f5e1f6c

Please sign in to comment.