From d82375e53e7d8ebb4b566545b1ef20740a6a55c9 Mon Sep 17 00:00:00 2001 From: HeliumAnt Date: Wed, 17 Jan 2024 15:13:30 +0100 Subject: [PATCH] add fixes to support clang --- external/sources/RakNet/meson.build | 3 ++- external/sources/RakNet/src/ReplicaManager3.cpp | 2 +- meson.build | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/external/sources/RakNet/meson.build b/external/sources/RakNet/meson.build index 198724766b..5652f8b599 100644 --- a/external/sources/RakNet/meson.build +++ b/external/sources/RakNet/meson.build @@ -9,6 +9,7 @@ deps = [] if cxx.get_argument_syntax() == 'gcc' cpp_args = ['-w', '-fpermissive'] + cpp_options = ['cpp_std=gnu++11'] if host_machine.system() == 'windows' cpp_args += ['-D_ITERATOR_DEBUG_LEVEL=0','-DWIN32','-D_RAKNET_LIB','-D_CRT_NONSTDC_NO_DEPRECATE','-D_CRT_SECURE_NO_DEPRECATE'] if get_option('debug') @@ -32,4 +33,4 @@ else endif raknet_dep = declare_dependency(link_with: raknet, dependencies: deps, include_directories: raknet_include) -meson.override_dependency('RakNet', raknet_dep) \ No newline at end of file +meson.override_dependency('RakNet', raknet_dep) diff --git a/external/sources/RakNet/src/ReplicaManager3.cpp b/external/sources/RakNet/src/ReplicaManager3.cpp index f67831cae4..070ed1249e 100644 --- a/external/sources/RakNet/src/ReplicaManager3.cpp +++ b/external/sources/RakNet/src/ReplicaManager3.cpp @@ -138,7 +138,7 @@ void ReplicaManager3::AutoCreateConnectionList( { for (unsigned int index=0; index < participantListIn.Size(); index++) { - if (GetConnectionByGUID(participantListIn[index], worldId)==false) + if (!GetConnectionByGUID(participantListIn[index], worldId)) { Connection_RM3 *connection = AllocConnection(rakPeerInterface->GetSystemAddressFromGuid(participantListIn[index]), participantListIn[index]); if (connection) diff --git a/meson.build b/meson.build index ffaca3c0de..57192c2502 100644 --- a/meson.build +++ b/meson.build @@ -14,7 +14,7 @@ override_options = [] suffix='' if compiler.get_id() == 'clang' - error('LLVM clang is not supported due to missing features of the clang standard library. (std::execution)') + warning('LLVM clang is not directly supported due to missing features of the clang standard library. Remember to set cpp_std to gnu++20 or force libstdc++ otherwise (std::execution)') endif if host_machine.system() == 'darwin' and get_option('b_lto')