diff --git a/Externals/cximage/ximadef.h b/Externals/cximage/ximadef.h index f00f59fff09..f372b940346 100644 --- a/Externals/cximage/ximadef.h +++ b/Externals/cximage/ximadef.h @@ -94,14 +94,15 @@ typedef struct tagcomplex { #include #include +#ifndef CXIMAGE_NO_WIN32_DEFINES typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned long DWORD; typedef unsigned int UINT; typedef const char* LPCTSTR; - -typedef DWORD COLORREF; typedef unsigned int HANDLE; +#endif +typedef DWORD COLORREF; typedef void* HRGN; typedef void* HDC; @@ -125,7 +126,7 @@ typedef int boolean; #define TCHAR char #define _T #endif - +#ifndef CXIMAGE_NO_WIN32_DEFINES typedef struct tagRECT { long left; @@ -139,7 +140,7 @@ typedef struct tagPOINT long x; long y; } POINT; - +#endif typedef struct tagRGBQUAD { BYTE rgbBlue; BYTE rgbGreen; diff --git a/src/xrGame/CMakeLists.txt b/src/xrGame/CMakeLists.txt index 183add8bf91..56fa79da882 100644 --- a/src/xrGame/CMakeLists.txt +++ b/src/xrGame/CMakeLists.txt @@ -40,6 +40,7 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/../xrServerEntities ${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/cximage ${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/GameSpy/src ${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/luabind ${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/ode/include diff --git a/src/xrGame/screenshot_manager.cpp b/src/xrGame/screenshot_manager.cpp index 4c5280426f2..53a1c72b007 100644 --- a/src/xrGame/screenshot_manager.cpp +++ b/src/xrGame/screenshot_manager.cpp @@ -9,7 +9,13 @@ #define CXIMAGE_AS_SHARED_LIBRARY #endif +#ifdef WINDOWS #include +#endif + +#ifdef LINUX // Avoid conflicting macros +#define CXIMAGE_NO_WIN32_DEFINES +#endif #include "ximage.h" #include "xmemfile.h" diff --git a/src/xrGame/ui/UIServerInfo.cpp b/src/xrGame/ui/UIServerInfo.cpp index c492fb9fc21..254a33b579d 100644 --- a/src/xrGame/ui/UIServerInfo.cpp +++ b/src/xrGame/ui/UIServerInfo.cpp @@ -8,6 +8,9 @@ #include "UIGameCustom.h" #include "Level.h" #include "game_cl_mp.h" +#ifdef LINUX // Avoid conflicting macros +#define CXIMAGE_NO_WIN32_DEFINES +#endif #include "ximage.h" #include "xmemfile.h" @@ -118,7 +121,7 @@ void CUIServerInfo::SetServerRules(u8 const* data_ptr, u32 const data_size) if (new_size > (sizeof(tmp_string) - 1)) new_size = (sizeof(tmp_string) - 1); - strncpy_s(tmp_string, reinterpret_cast(data_ptr), new_size); + strncpy_s(tmp_string, sizeof(tmp_string), reinterpret_cast(data_ptr), new_size); tmp_string[new_size] = 0; // std::replace(tmp_string, tmp_string + new_size, '\r', '\\');