Skip to content

Commit

Permalink
xrEngine: fix some Linux compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Jun 19, 2018
1 parent 95c0f3b commit dac3979
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Common/PlatformLinux.inl
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ inline int _filelength(int fd)
#define __min(a, b) std::min(a, b)

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

#define ZeroMemory(p, sz) memset((p), 0, (sz))
#define CopyMemory(d, s, n) memcpy(d, s, n)
Expand Down
4 changes: 4 additions & 0 deletions src/Include/editor/property_holder_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ class property_holder_holder
{
public:
virtual property_holder_base* object() = 0;
#if defined(WINDOWS)
virtual ~property_holder_holder() = 0 {}
#elif defined(LINUX)
virtual ~property_holder_holder() = 0;
#endif
};

class property_holder_collection
Expand Down
3 changes: 2 additions & 1 deletion src/xrEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/OpenAutomate/inc
${CMAKE_CURRENT_SOURCE_DIR}/../../Externals/FreeImage/Dist/x64
${CMAKE_CURRENT_SOURCE_DIR}/../../sdk/include
/usr/include/SDL2
)

#list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./xr_cda.cpp")
list(REMOVE_ITEM ${PROJECT_NAME}__SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/./editor_environment_manager_properties.cpp")
#list(REMOVE_ITEM ${PROJECT_NAME}__INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/./xr_cda.h")

add_definitions(-DENGINE_BUILD)
Expand Down
2 changes: 2 additions & 0 deletions src/xrEngine/IPHdebug.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "xrCore/_types.h"

xr_pure_interface IPhDebugRender
{
virtual void open_cashed_draw() = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/editor_environment_suns_flares.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ class flare;
class flares : private Noncopyable
{
public:
typedef xr_vector<flare*> flares_type;
flares();
virtual ~flares();
void load(CInifile& config, shared_str const& section);
void save(CInifile& config, shared_str const& section);
void fill(manager const& manager, XRay::Editor::property_holder_base* holder, XRay::Editor::property_holder_collection* collection);

private:
typedef xr_vector<flare*> flares_type;
typedef XRay::Editor::property_holder_collection property_holder_collection;

public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class collection : public SThunderboltCollection, public XRay::Editor::property_

public:
virtual property_holder_type* object();
typedef xr_vector<thunderbolt_id*> container_type;

private:
typedef xr_vector<thunderbolt_id*> container_type;
typedef property_collection<container_type, collection> collection_type;

private:
Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/editor_environment_weathers_weather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ shared_str weather::generate_unique_id(shared_str const& start) const
VERIFY(is_digit(id[7]));

u32 hours, minutes, seconds;
sscanf_s(id, "%02d:%02d:%02d", &hours, &minutes, &seconds);
sscanf(id, "%02d:%02d:%02d", &hours, &minutes, &seconds);

shared_str result;

Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/engine_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ char const* engine_impl::weather_current_time() const
void engine_impl::weather_current_time(char const* time)
{
u32 hours, minutes, seconds;
sscanf_s(time, "%d:%d:%d", &hours, &minutes, &seconds);
sscanf(time, "%d:%d:%d", &hours, &minutes, &seconds);
bool paused = g_pGamePersistent->Environment().m_paused;

g_pGamePersistent->Environment().m_paused = false;
Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/property_collection_inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void PROPERTY_COLLECTION::erase(u32 const& position)
make_state_changed();

VERIFY(position < m_container.size());
container_type::value_type value = m_container[position];
typename container_type::value_type value = m_container[position];
m_container.erase(m_container.begin() + position);
delete_data(value);
}
Expand Down
1 change: 1 addition & 0 deletions src/xrEngine/pure_relcase.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define pure_relcaseH
#include "xrCore/xrDebug_macros.h"
#include "xrCore/fastdelegate.h" // XXX: Inluding this VERY heavy file for just xr_stdcall seems suboptimal.
#include "IGame_Level.h"

class IGameObject;

Expand Down

0 comments on commit dac3979

Please sign in to comment.