Skip to content

Commit b02dda3

Browse files
authored
Merge pull request #6 from Zegeri/clang-support
Fix clang compilation
2 parents b1aaba6 + 5badae3 commit b02dda3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+271
-140
lines changed

cmake/FindTBB.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ if (UNIX)
9898
# has itanium/*
9999
set(_TBB_COMPILER ${TBB_COMPILER})
100100
set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
101+
102+
# Fix for clang compiler
103+
# https://www.threadingbuildingblocks.org/docs/help/reference/appendices/known_issues/linux_os.html
104+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
105+
string(REPLACE "." "0" TBB_USE_GLIBCXX_VERSION ${CMAKE_CXX_COMPILER_VERSION})
106+
add_definitions(-DTBB_USE_GLIBCXX_VERSION=${TBB_USE_GLIBCXX_VERSION})
107+
endif()
101108
endif (APPLE)
102109
endif (UNIX)
103110

src/Common/PlatformLinux.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ inline void _splitpath (
115115
}
116116

117117
#include <iostream>
118-
inline void OutputDebugString(char *str) // for linux debugger
118+
inline void OutputDebugString(const char *str) // for linux debugger
119119
{
120120
std::cerr << str;
121121
}
@@ -202,7 +202,7 @@ typedef struct _EXCEPTION_POINTERS {
202202

203203
#ifdef XR_X64
204204
typedef int64_t INT_PTR;
205-
typedef uint16_t UINT_PTR;
205+
typedef uint64_t UINT_PTR;
206206
typedef int64_t LONG_PTR;
207207
#else
208208
typedef int INT_PTR;

src/utils/xrMiscMath/vector3d_ext.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "pch.hpp"
2-
#include "xrCore/_vector3d_ext.h"
32
#include "xrCommon/math_funcs_inline.h"
3+
#include "xrCore/_vector3d_ext.h"
44

55
float dotproduct(const Fvector& v1, const Fvector& v2)
66
{

src/utils/xrQSlim/src/MxDynBlock.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class MxDynBlock : public MxBlock<T>
1818
{
1919
private:
2020
int fill;
21+
using MxBlock<T>::resize;
22+
using MxBlock<T>::begin;
2123

2224
public:
2325
MxDynBlock(int n = 2) : MxBlock<T>(n) { fill = 0; }

src/xrAICore/AISpaceBase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include "AISpaceBase.hpp"
33
#include "Navigation/game_graph.h"
44
#include "Navigation/level_graph.h"
5-
#include "Navigation/graph_engine.h"
65
#include "Navigation/PatrolPath/patrol_path_storage.h"
6+
#include "Navigation/graph_engine.h"
77

88
AISpaceBase::AISpaceBase() { GEnv.AISpace = this; }
99
AISpaceBase::~AISpaceBase()

src/xrAICore/Components/problem_solver.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include "xrCore/Containers/AssociativeVector.hpp"
1212
#include "Common/object_broker.h"
1313

14-
class CGraphEngine;
15-
1614
template <typename _operator_condition, typename _condition_state, typename _operator, typename _condition_evaluator,
1715
typename _operator_id_type, bool _reverse_search = false, typename _operator_ptr = _operator*,
1816
typename _condition_evaluator_ptr = _condition_evaluator*>

src/xrAICore/Components/problem_solver_inline.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
#pragma once
1010

11+
#ifndef AI_COMPILER
12+
#include "xrAICore/Navigation/graph_engine.h"
13+
#endif
14+
1115
#define TEMPLATE_SPECIALIZATION \
1216
template <typename _operator_condition, typename _operator, typename _condition_state, \
1317
typename _condition_evaluator, typename _operator_id_type, bool _reverse_search, typename _operator_ptr, \

src/xrAICore/Navigation/ai_object_location_impl.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@
1212
#include "xrAICore/Navigation/game_graph.h"
1313
#include "xrAICore/Navigation/level_graph.h"
1414

15-
IC void CAI_ObjectLocation::init()
16-
{
17-
if (ai().get_level_graph())
18-
ai().level_graph().set_invalid_vertex(m_level_vertex_id);
19-
else
20-
m_level_vertex_id = u32(-1);
21-
22-
if (ai().get_game_graph())
23-
ai().game_graph().set_invalid_vertex(m_game_vertex_id);
24-
else
25-
m_game_vertex_id = GameGraph::_GRAPH_ID(-1);
26-
}
27-
2815
IC void CAI_ObjectLocation::game_vertex(CVertex const* game_vertex)
2916
{
3017
VERIFY(ai().game_graph().valid_vertex_id(ai().game_graph().vertex_id(game_vertex)));

src/xrAICore/Navigation/ai_object_location_inline.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@
88

99
#pragma once
1010

11+
#include "xrAICore/Navigation/level_graph.h"
12+
13+
IC void CAI_ObjectLocation::init()
14+
{
15+
if (ai().get_level_graph())
16+
ai().level_graph().set_invalid_vertex(m_level_vertex_id);
17+
else
18+
m_level_vertex_id = u32(-1);
19+
20+
if (ai().get_game_graph())
21+
ai().game_graph().set_invalid_vertex(m_game_vertex_id);
22+
else
23+
m_game_vertex_id = GameGraph::_GRAPH_ID(-1);
24+
}
25+
1126
IC CAI_ObjectLocation::CAI_ObjectLocation() { init(); }
1227
IC void CAI_ObjectLocation::reinit() { init(); }
1328
IC const GameGraph::_GRAPH_ID CAI_ObjectLocation::game_vertex_id() const { return (m_game_vertex_id); }

src/xrCore/FS.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,11 @@ class XRCORE_API IReader : public IReaderBase<IReader>
410410
class XRCORE_API CVirtualFileRW : public IReader
411411
{
412412
private:
413+
#if defined(WINDOWS)
413414
void *hSrcFile, *hSrcMap;
415+
#elif defined(LINUX)
416+
int hSrcFile;
417+
#endif
414418

415419
public:
416420
CVirtualFileRW(const char* cFileName);

0 commit comments

Comments
 (0)