From 52fcd4b70bdfb50b525257680a42eed27236dc7b Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Sat, 5 Feb 2022 18:22:32 +0100 Subject: [PATCH] #18 add swap_endian_on_le --- BaseCommon/Utils.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BaseCommon/Utils.h b/BaseCommon/Utils.h index 0e60527..549392f 100644 --- a/BaseCommon/Utils.h +++ b/BaseCommon/Utils.h @@ -87,4 +87,14 @@ public: return u; } + + // Ersatz for macro wxINT32_SWAP_ON_LE + template + static T swap_endian_le(T u) + { + if(!is_big_endian()) + return swap_endian(u); + + return u; + } };