From 2b944146ee1b48be08e2cb0d23b664469471721d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Lu=C3=ADs=20Vaz=20Silva?= Date: Sat, 23 Sep 2023 16:28:35 -0300 Subject: [PATCH] disable r_particles_multithreaded on platforms missing library support --- src/playsim/p_effect.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/playsim/p_effect.cpp b/src/playsim/p_effect.cpp index 0fd25f12389..ff99c7aa60f 100644 --- a/src/playsim/p_effect.cpp +++ b/src/playsim/p_effect.cpp @@ -34,7 +34,11 @@ ** more useful. */ -#include +#if __has_include() + + #include + +#endif #include "doomtype.h" #include "doomstat.h" @@ -58,7 +62,12 @@ CVAR (Bool, r_rail_smartspiral, false, CVAR_ARCHIVE); CVAR (Int, r_rail_spiralsparsity, 1, CVAR_ARCHIVE); CVAR (Int, r_rail_trailsparsity, 1, CVAR_ARCHIVE); CVAR (Bool, r_particles, true, 0); -CVAR (Bool, r_particles_multithreaded, true, CVAR_ARCHIVE); + +#if __has_include() + + CVAR (Bool, r_particles_multithreaded, true, CVAR_ARCHIVE); + +#endif EXTERN_CVAR(Int, r_maxparticles); FRandom pr_railtrail("RailTrail"); @@ -280,6 +289,7 @@ void P_ThinkParticles (FLevelLocals *Level) { uint64_t startNs = I_nsTime(); std::deque::iterator newEnd; +#if __has_include() if(r_particles_multithreaded) { newEnd = std::remove_if(std::execution::par_unseq, Level->Particles.begin(), Level->Particles.end(), [Level](particle_t &p) @@ -288,6 +298,7 @@ void P_ThinkParticles (FLevelLocals *Level) }); } else +#endif { newEnd = std::remove_if(Level->Particles.begin(), Level->Particles.end(), [Level](particle_t &p) {