From 4ba871c631d5362cba1bf90c3fecc03d0f0bc484 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 2 Oct 2020 15:27:47 +0100 Subject: Remove use of the deprecated register keyword. Fixes a build error on C++17 compilers. --- src/hashcomp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp index d88a23142..7eac1205a 100644 --- a/src/hashcomp.cpp +++ b/src/hashcomp.cpp @@ -63,7 +63,7 @@ int ci::ci_char_traits::compare(const char *str1, const char *str2, size_t n) { for (unsigned i = 0; i < n; ++i) { - register unsigned char c1 = case_map_upper[static_cast(*str1)], + unsigned char c1 = case_map_upper[static_cast(*str1)], c2 = case_map_upper[static_cast(*str2)]; if (c1 > c2) -- cgit From af8056d2ddf1822ac2a811f8009989cbf91f4f54 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 6 Oct 2020 14:52:21 +0100 Subject: Simplify the definition of _le64toh in the siphash implementation. --- src/siphash.cpp | 58 +++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/siphash.cpp b/src/siphash.cpp index abe6b53bf..796624978 100644 --- a/src/siphash.cpp +++ b/src/siphash.cpp @@ -38,33 +38,47 @@ #include "services.h" #include "anope.h" -#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -# define _le64toh(x) ((uint64_t)(x)) -#elif defined(_WIN32) -/* Windows is always little endian, unless you're on xbox360 - http://msdn.microsoft.com/en-us/library/b0084kay(v=vs.80).aspx */ -# define _le64toh(x) ((uint64_t)(x)) -#elif defined(__APPLE__) +// WARNING: This ifdef maze could be a lot simpler but unfortunately +// that will cause find_includes to be unable to parse it. + +#ifdef __APPLE__ # include # define _le64toh(x) OSSwapLittleToHostInt64(x) -#else - -/* See: http://sourceforge.net/p/predef/wiki/Endianness/ */ -# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) -# include -# else -# include -# endif -# if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ - __BYTE_ORDER == __LITTLE_ENDIAN -# define _le64toh(x) ((uint64_t)(x)) -# else -# define _le64toh(x) le64toh(x) -# endif +#endif + +#ifdef __FreeBSD__ +# include +# define _le64toh(x) le64toh(x) +#endif + +#ifdef __linux__ +# include +#endif +#ifdef __NetBSD__ +# include +# define _le64toh(x) le64toh(x) #endif +#ifdef __OpenBSD__ +# include +# define _le64toh(x) le64toh(x) +#endif + +// Windows is always little endian. +#ifdef _WIN32 +# define _le64toh(x) ((uint64_t)(x)) +#endif + +// Attempt to work on unenumerated platforms. +#if defined(le64toh) && !defined(__le64toh) +# define _le64toh le64toh +#endif + +// We can't do anything about this. +#ifndef _le64toh +# error Please define _le64toh for your platform! +#endif #define ROTATE(x, b) (uint64_t)( ((x) << (b)) | ( (x) >> (64 - (b))) ) -- cgit From f8777097d13f3eb47284c32fceb44e8db20491c2 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 7 Oct 2020 12:46:37 +0100 Subject: Fix last case check for le64toh. --- src/siphash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/siphash.cpp b/src/siphash.cpp index 796624978..03b042cb6 100644 --- a/src/siphash.cpp +++ b/src/siphash.cpp @@ -71,7 +71,7 @@ #endif // Attempt to work on unenumerated platforms. -#if defined(le64toh) && !defined(__le64toh) +#if defined(le64toh) && !defined(_le64toh) # define _le64toh le64toh #endif -- cgit From 46e1395e62ad4d9a028b51f72d8d6a92187cf9b9 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 7 Oct 2020 12:58:00 +0100 Subject: Release 2.0.8. --- src/version.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/version.sh b/src/version.sh index 7c2ca8ad1..9458e1220 100644 --- a/src/version.sh +++ b/src/version.sh @@ -3,4 +3,4 @@ VERSION_MAJOR=2 VERSION_MINOR=0 VERSION_PATCH=8 -VERSION_EXTRA="-git" +VERSION_EXTRA="" -- cgit