summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-10 02:34:58 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-07-10 02:34:58 +0000
commitb285ef3229737b772853b7042b767896ce73fa1f (patch)
tree9480f4022a728d85ec617f4cc83d0af2832289d7
parent045d266246f5ab996777561e4af38ec9cadeb15a (diff)
Support for systems without stdint.h (we make a guess at sizeof(unsigned int) == 32... if youre running an outdated OS its your own fault)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4261 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_opermd5.cpp6
-rw-r--r--src/modules/m_opersha256.cpp (renamed from src/modules/extra/m_opersha256.cpp)7
2 files changed, 12 insertions, 1 deletions
diff --git a/src/modules/m_opermd5.cpp b/src/modules/m_opermd5.cpp
index c5ac5a0ee..d99b9a96e 100644
--- a/src/modules/m_opermd5.cpp
+++ b/src/modules/m_opermd5.cpp
@@ -20,7 +20,7 @@ using namespace std;
#include <stdio.h>
#include "inspircd_config.h"
-#ifdef STDINT_H
+#ifdef HAS_STDINT
#include <stdint.h>
#endif
#include "users.h"
@@ -38,6 +38,10 @@ using namespace std;
#define MD5STEP(f,w,x,y,z,in,s) \
(w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
+#ifndef HAS_STDINT
+typedef unsigned int uint32_t;
+#endif
+
typedef uint32_t word32; /* NOT unsigned long. We don't support 16 bit platforms, anyway. */
typedef unsigned char byte;
diff --git a/src/modules/extra/m_opersha256.cpp b/src/modules/m_opersha256.cpp
index 82caa9d12..a13028061 100644
--- a/src/modules/extra/m_opersha256.cpp
+++ b/src/modules/m_opersha256.cpp
@@ -37,7 +37,10 @@
using namespace std;
#include <stdio.h>
+#include "inspircd_config.h"
+#ifdef HAS_STDINT
#include <stdint.h>
+#endif
#include "users.h"
#include "channels.h"
#include "modules.h"
@@ -48,6 +51,10 @@ static Server *Srv;
#define SHA256_DIGEST_SIZE (256 / 8)
#define SHA256_BLOCK_SIZE (512 / 8)
+#ifndef HAS_STDINT
+typedef unsigned int uint32_t;
+#endif
+
struct SHA256Context
{
unsigned int tot_len;