aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-06-19 19:47:52 +0100
committerGravatar Sadie Powell2021-06-19 19:47:52 +0100
commitab31e370020653a280e0d06945eab2c110f25a2d (patch)
treef42a010a33eecaf0212be6b269f6f335f1ed6f1f /src/modules
parentReorder <limits> alphabetically in the example config. (diff)
Fix building the sha256 module on Haiku.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_sha256.cpp15
1 files changed, 13 insertions, 2 deletions
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 <sha2.c>
+#ifdef __HAIKU__
+# undef uint64
+#endif
+
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif
+#include "inspircd.h"
+#include "modules/hash.h"
+
class HashSHA256 : public HashProvider
{
public: