diff --git a/lib/main/core/pibase.h b/lib/main/core/pibase.h index 5f0f280d..cad880fd 100644 --- a/lib/main/core/pibase.h +++ b/lib/main/core/pibase.h @@ -302,7 +302,11 @@ template<> inline void piSwapBinary(const void *& f, const void *& s) { template<> inline void piSwap(double & f, double & s) {piSwapBinary(f, s);} template<> inline void piSwap(ldouble & f, ldouble & s) {piSwapBinary(f, s);} - +#ifdef ARCH_BITS_32 +template<> inline void piSwap(float & f, float & s) {piSwapBinary(f, s);} +template<> inline void piSwap(llong & f, llong & s) {piSwapBinary(f, s);} +template<> inline void piSwap(ullong & f, ullong & s) {piSwapBinary(f, s);} +#endif /*! \brief Function for compare two values without "=" by raw content * \details Example:\n \snippet piincludes.cpp compareBinary */ diff --git a/lib/main/piplatform.h b/lib/main/piplatform.h index 8fc0331d..597520b8 100644 --- a/lib/main/piplatform.h +++ b/lib/main/piplatform.h @@ -24,13 +24,14 @@ #define PIP_CXX11_SUPPORT #endif -#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) -# define WINDOWS -# define ARCH_BITS_32 -#endif #if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) # define WINDOWS # define ARCH_BITS_64 +#else +# if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) +# define WINDOWS +# define ARCH_BITS_32 +# endif #endif #if defined(__QNX__) || defined(__QNXNTO__) # define QNX diff --git a/main.cpp b/main.cpp index 9eb4b570..02c74164 100644 --- a/main.cpp +++ b/main.cpp @@ -119,8 +119,10 @@ struct A { void swap(int & x, int & y) {int t = x; x = y; y = t;} void swap2(int & x, int & y) {int t(std::move(x)); x = y; y = t;} -void swap(size_t & x, size_t & y) {size_t t = x; x = y; y = t;} -void swap2(size_t & x, size_t & y) {size_t t{std::move(x)}; x = y; y = t;} +void swap(ullong & x, ullong & y) {ullong t = x; x = y; y = t;} +void swap2(ullong & x, ullong & y) {ullong t{std::move(x)}; x = y; y = t;} +void swap(llong & x, llong & y) {llong t = x; x = y; y = t;} +void swap2(llong & x, llong & y) {llong t{std::move(x)}; x = y; y = t;} void swap(double & x, double & y) {double t = x; x = y; y = t;} void swap2(double & x, double & y) {double t(std::move(x)); x = std::move(y); y = std::move(t);} void swap(float & x, float & y) {float t = x; x = y; y = t;}