Skip to content

Commit

Permalink
Engine can be compiled with Clang (closes #289, closes #499)
Browse files Browse the repository at this point in the history
Tested on WSL using Clang-10. Couldn't run the game, though, needs checking why.
  • Loading branch information
Xottab-DUTY committed Jan 15, 2022
1 parent 198f760 commit 7cf51c3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
message(FATAL_ERROR "Building with a MCST lcc version less than 1.25 is not supported.")
endif()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument -Wno-inconsistent-missing-override")
# XXX: Remove -fdelayed-template-parsing
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdelayed-template-parsing -Wno-unused-command-line-argument -Wno-inconsistent-missing-override")
if (NOT USED_CXX_LIB)
set(USED_CXX_LIB "libstdcpp" CACHE STRING "" FORCE)
set(USED_CXX_LIB "libcpp" CACHE STRING "" FORCE)
endif()
if (USED_CXX_LIB STREQUAL "libstdcpp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
Expand Down
3 changes: 0 additions & 3 deletions Externals/ode/ode/src/quickstep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,12 @@ static void SOR_LCP (int m, int nb, dRealMutablePtr J, int *jb, dxBody * const *
#endif
#ifdef RANDOMLY_REORDER_CONSTRAINTS
if ((iteration & 3) == 0) {
std::random_shuffle (order,order+m);
/*
for (i=1; i<m; ++i) {
IndexError tmp = order[i];
int swapi = dRandInt(i+1);
order[i] = order[swapi];
order[swapi] = tmp;
}
*/
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/xrSheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ENGINE_API CSheduler
ISheduled* Object;
u32 dwPadding; // for align-issues

IC bool operator<(Item& I) { return dwTimeForExecute > I.dwTimeForExecute; }
ICF bool operator<(const Item& I) const { return dwTimeForExecute > I.dwTimeForExecute; }
};
struct ItemReg
{
Expand Down

0 comments on commit 7cf51c3

Please sign in to comment.