From e555d15cc740034fb6e33f628e9c1a58bf118a05 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 20 Jan 2020 01:32:39 +0100 Subject: [PATCH] renamed the swap function in pragmas.h This conflicts with std::swap on some setups. --- source/build/include/pragmas.h | 15 +++++++-------- source/duke3d/src/gameexec.cpp | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/source/build/include/pragmas.h b/source/build/include/pragmas.h index 922917289..1c143c99e 100644 --- a/source/build/include/pragmas.h +++ b/source/build/include/pragmas.h @@ -132,21 +132,20 @@ EDUKE32_GENERATE_PRAGMAS EDUKE32_SCALER_PRAGMA(32) template -static FORCE_INLINE void swap(T * const a, T * const b) +static FORCE_INLINE void swapptr(T * const a, T * const b) { T const t = *a; *a = *b; *b = t; } -#define swapptr swap #ifndef pragmas_have_swaps -#define swapchar swap -#define swapshort swap -#define swaplong swap -#define swapfloat swap -#define swapdouble swap -#define swap64bit swap +#define swapchar swapptr +#define swapshort swapptr +#define swaplong swapptr +#define swapfloat swapptr +#define swapdouble swapptr +#define swap64bit swapptr static FORCE_INLINE void swapchar2(void *a, void *b, int32_t s) { diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 22273e3d9..70ee7f35c 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -5802,8 +5802,8 @@ badindex: auto &array1 = aGameArrays[*insptr++]; auto &array2 = aGameArrays[*insptr++]; - swap(&array1.size, &array2.size); - swap(&array1.pValues, &array2.pValues); + swapptr(&array1.size, &array2.size); + swapptr(&array1.pValues, &array2.pValues); dispatch(); }