From ab31e370020653a280e0d06945eab2c110f25a2d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 19 Jun 2021 19:47:52 +0100 Subject: Fix building the sha256 module on Haiku. --- src/modules/m_sha256.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/modules/m_sha256.cpp') diff --git a/src/modules/m_sha256.cpp b/src/modules/m_sha256.cpp index 5cb55468a..b8d8ff269 100644 --- a/src/modules/m_sha256.cpp +++ b/src/modules/m_sha256.cpp @@ -26,6 +26,7 @@ /// $CompilerFlags: -Ivendor_directory("sha2") /// $CompilerFlags: require_compiler("GCC") -Wno-long-long + #ifdef __GNUC__ # pragma GCC diagnostic push #endif @@ -37,15 +38,25 @@ # pragma GCC diagnostic ignored "-Wlong-long" #endif -#include "inspircd.h" -#include "modules/hash.h" +// Fix a collision between the Haiku uint64 typedef and the +// one from the sha2 library. +#ifdef __HAIKU__ +# define uint64 sha2_uint64 +#endif #include +#ifdef __HAIKU__ +# undef uint64 +#endif + #ifdef __GNUC__ # pragma GCC diagnostic pop #endif +#include "inspircd.h" +#include "modules/hash.h" + class HashSHA256 : public HashProvider { public: -- cgit v1.3.1-10-gc9f91