Skip to content

Commit dac3979

Browse files
committed
xrEngine: fix some Linux compilation errors
1 parent 95c0f3b commit dac3979

10 files changed

+15
-6
lines changed

src/Common/PlatformLinux.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ inline int _filelength(int fd)
266266
#define __min(a, b) std::min(a, b)
267267

268268
#define itoa SDL_itoa
269+
#define _itoa_s(value, buffer, radix) SDL_itoa(value, buffer, radix)
269270

270271
#define ZeroMemory(p, sz) memset((p), 0, (sz))
271272
#define CopyMemory(d, s, n) memcpy(d, s, n)

src/Include/editor/property_holder_base.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ class property_holder_holder
3333
{
3434
public:
3535
virtual property_holder_base* object() = 0;
36+
#if defined(WINDOWS)
3637
virtual ~property_holder_holder() = 0 {}
38+
#elif defined(LINUX)
39+
virtual ~property_holder_holder() = 0;
40+
#endif
3741
};
3842

3943
class property_holder_collection

src/xrEngine/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ include_directories(
1111
${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/OpenAutomate/inc
1212
${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/FreeImage/Dist/x64
1313
${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include
14+
/usr/include/SDL2
1415
)
1516

16-
#list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./xr_cda.cpp")
17+
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./editor_environment_manager_properties.cpp")
1718
#list(REMOVE_ITEM ${PROJECT_NAME}__INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/./xr_cda.h")
1819

1920
add_definitions(-DENGINE_BUILD)

src/xrEngine/IPHdebug.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include "xrCore/_types.h"
4+
35
xr_pure_interface IPhDebugRender
46
{
57
virtual void open_cashed_draw() = 0;

src/xrEngine/editor_environment_suns_flares.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ class flare;
3131
class flares : private Noncopyable
3232
{
3333
public:
34+
typedef xr_vector<flare*> flares_type;
3435
flares();
3536
virtual ~flares();
3637
void load(CInifile& config, shared_str const& section);
3738
void save(CInifile& config, shared_str const& section);
3839
void fill(manager const& manager, XRay::Editor::property_holder_base* holder, XRay::Editor::property_holder_collection* collection);
3940

4041
private:
41-
typedef xr_vector<flare*> flares_type;
4242
typedef XRay::Editor::property_holder_collection property_holder_collection;
4343

4444
public:

src/xrEngine/editor_environment_thunderbolts_collection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ class collection : public SThunderboltCollection, public XRay::Editor::property_
3939

4040
public:
4141
virtual property_holder_type* object();
42+
typedef xr_vector<thunderbolt_id*> container_type;
4243

4344
private:
44-
typedef xr_vector<thunderbolt_id*> container_type;
4545
typedef property_collection<container_type, collection> collection_type;
4646

4747
private:

src/xrEngine/editor_environment_weathers_weather.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ shared_str weather::generate_unique_id(shared_str const& start) const
234234
VERIFY(is_digit(id[7]));
235235

236236
u32 hours, minutes, seconds;
237-
sscanf_s(id, "%02d:%02d:%02d", &hours, &minutes, &seconds);
237+
sscanf(id, "%02d:%02d:%02d", &hours, &minutes, &seconds);
238238

239239
shared_str result;
240240

src/xrEngine/engine_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ char const* engine_impl::weather_current_time() const
317317
void engine_impl::weather_current_time(char const* time)
318318
{
319319
u32 hours, minutes, seconds;
320-
sscanf_s(time, "%d:%d:%d", &hours, &minutes, &seconds);
320+
sscanf(time, "%d:%d:%d", &hours, &minutes, &seconds);
321321
bool paused = g_pGamePersistent->Environment().m_paused;
322322

323323
g_pGamePersistent->Environment().m_paused = false;

src/xrEngine/property_collection_inline.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void PROPERTY_COLLECTION::erase(u32 const& position)
6363
make_state_changed();
6464

6565
VERIFY(position < m_container.size());
66-
container_type::value_type value = m_container[position];
66+
typename container_type::value_type value = m_container[position];
6767
m_container.erase(m_container.begin() + position);
6868
delete_data(value);
6969
}

src/xrEngine/pure_relcase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define pure_relcaseH
44
#include "xrCore/xrDebug_macros.h"
55
#include "xrCore/fastdelegate.h" // XXX: Inluding this VERY heavy file for just xr_stdcall seems suboptimal.
6+
#include "IGame_Level.h"
67

78
class IGameObject;
89

0 commit comments

Comments
 (0)