From 9b74f402568e135995a5730edd074136be93f7bd Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 27 Jul 2013 20:13:49 +1000 Subject: fix compilation errors on VS2008; mostly from a patch from Florian Ruechel issue#1 --- bcrypt/bcrypt.c | 3 ++- bcrypt/bcrypt_python.c | 7 +++---- bcrypt/pybc_blf.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bcrypt/bcrypt.c b/bcrypt/bcrypt.c index 98ecbef..8f5812d 100644 --- a/bcrypt/bcrypt.c +++ b/bcrypt/bcrypt.c @@ -52,8 +52,9 @@ #include "pybc_blf.h" -#if defined(_MSC_VER) +#if defined(_WIN32) #define snprintf _snprintf +#define bzero(s,n) memset(s, '\0', n) #endif /* This implementation is adaptable to current computing power. diff --git a/bcrypt/bcrypt_python.c b/bcrypt/bcrypt_python.c index 5d33617..6154f5c 100644 --- a/bcrypt/bcrypt_python.c +++ b/bcrypt/bcrypt_python.c @@ -16,10 +16,11 @@ #include "Python.h" -#if defined(_MSC_VER) +#if defined(_WIN32) typedef unsigned __int8 u_int8_t; typedef unsigned __int16 u_int16_t; typedef unsigned __int32 u_int32_t; +#define bzero(s,n) memset(s, '\0', n) #endif /* $Id$ */ @@ -67,10 +68,8 @@ bcrypt_hashpw(PyObject *self, PyObject *args, PyObject *kw_args) { static char *keywords[] = { "password", "salt", NULL }; char *password = NULL, *salt = NULL; - char hashed[128]; + char hashed[128], char *password_copy, *salt_copy; int ret; - char *password_copy; - char *salt_copy; if (!PyArg_ParseTupleAndKeywords(args, kw_args, "ss:hashpw", keywords, &password, &salt)) diff --git a/bcrypt/pybc_blf.h b/bcrypt/pybc_blf.h index 92e8ea2..55ac12c 100644 --- a/bcrypt/pybc_blf.h +++ b/bcrypt/pybc_blf.h @@ -34,7 +34,7 @@ #ifndef _PYBC_BLF_H_ #define _PYBC_BLF_H_ -#if defined(_MSC_VER) +#if defined(_WIN32) typedef unsigned __int8 u_int8_t; typedef unsigned __int16 u_int16_t; typedef unsigned __int32 u_int32_t; -- cgit v1.2.1