summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm <devnull@localhost>2006-08-08 02:34:02 +0000
committerdjm <devnull@localhost>2006-08-08 02:34:02 +0000
commitffeb7a6ef295f1ed4b0d9988855acd602410fde9 (patch)
tree6532f6e5f5542f6779498f47ab51e0ece03e25a3
parent08f7132af5c94eaababc9811afb2a90c9c9e2bf8 (diff)
downloadpy-bcrypt-ffeb7a6ef295f1ed4b0d9988855acd602410fde9.tar.gz
- (djm) Add support for Win32
-rw-r--r--ChangeLog3
-rw-r--r--bcrypt/bcrypt.c5
-rw-r--r--bcrypt/bcrypt_python.c8
-rw-r--r--bcrypt/pybc_blf.h6
-rwxr-xr-xsetup.py1
5 files changed, 21 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 11165e3..9d8dd5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,2 +1,5 @@
+20060808
+ - (djm) Add support for Win32
+
20060522
- (djm) Start
diff --git a/bcrypt/bcrypt.c b/bcrypt/bcrypt.c
index 5f12013..30d48aa 100644
--- a/bcrypt/bcrypt.c
+++ b/bcrypt/bcrypt.c
@@ -49,8 +49,13 @@
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
+
#include "pybc_blf.h"
+#if defined(_MSC_VER)
+#define snprintf _snprintf
+#endif
+
/* This implementation is adaptable to current computing power.
* You can have up to 2^31 rounds which should be enough for some
* time to come.
diff --git a/bcrypt/bcrypt_python.c b/bcrypt/bcrypt_python.c
index 8929569..54d1f40 100644
--- a/bcrypt/bcrypt_python.c
+++ b/bcrypt/bcrypt_python.c
@@ -16,6 +16,12 @@
#include "Python.h"
+#if defined(_MSC_VER)
+typedef unsigned __int8 u_int8_t;
+typedef unsigned __int16 u_int16_t;
+typedef unsigned __int32 u_int32_t;
+#endif
+
/* $Id$ */
/* Import */
@@ -91,6 +97,6 @@ init_bcrypt(void)
PyObject *m;
m = Py_InitModule3("bcrypt._bcrypt", bcrypt_methods, module_doc);
- PyModule_AddStringConstant(m, "__version__", PROGVER);
+ PyModule_AddStringConstant(m, "__version__", "0.1");
}
diff --git a/bcrypt/pybc_blf.h b/bcrypt/pybc_blf.h
index 269e25c..92e8ea2 100644
--- a/bcrypt/pybc_blf.h
+++ b/bcrypt/pybc_blf.h
@@ -34,6 +34,12 @@
#ifndef _PYBC_BLF_H_
#define _PYBC_BLF_H_
+#if defined(_MSC_VER)
+typedef unsigned __int8 u_int8_t;
+typedef unsigned __int16 u_int16_t;
+typedef unsigned __int32 u_int32_t;
+#endif
+
/* Schneier specifies a maximum key length of 56 bytes.
* This ensures that every key bit affects every cipher
* bit. However, the subkeys can hold up to 72 bytes.
diff --git a/setup.py b/setup.py
index 6aef0c7..3f5325b 100755
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,6 @@ VERSION = "0.1"
if __name__ == '__main__':
bcrypt = Extension('bcrypt._bcrypt',
- define_macros = [('PROGVER', '"' + VERSION + '"')],
sources = ['bcrypt/bcrypt_python.c', 'bcrypt/blowfish.c',
'bcrypt/bcrypt.c'])
setup( name = "bcrypt",