diff options
author | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2011-10-10 23:33:38 -0400 |
---|---|---|
committer | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2011-10-10 23:37:51 -0400 |
commit | 7401e648d44f9324a313346f45e86fc5e779a7aa (patch) | |
tree | be30ac9265b6ea5f8913aed1c6e9ace6eabe9216 | |
parent | 323ce9ef951378dc96ce14c9e514e9aa19ab39d9 (diff) | |
download | pycrypto-7401e648d44f9324a313346f45e86fc5e779a7aa.tar.gz |
Fix build on Solaris 9 and eariler
We use <sys/inttypes.h> on Solaris platforms that don't have <stdint.h>.
This should fix https://bugs.launchpad.net/pycrypto/+bug/518871, reported by
Sebastian Kayser.
-rw-r--r-- | ACKS | 1 | ||||
-rw-r--r-- | src/Blowfish.c | 9 | ||||
-rw-r--r-- | src/RIPEMD160.c | 10 | ||||
-rw-r--r-- | src/_counter.h | 9 | ||||
-rw-r--r-- | src/inc-msvc/config.h | 3 |
5 files changed, 29 insertions, 3 deletions
@@ -29,6 +29,7 @@ Philippe Frycia Peter Gutmann Hirendra Hindocha Nikhil Jhingan +Sebastian Kayser Ryan Kelly Andrew M. Kuchling Piers Lauder diff --git a/src/Blowfish.c b/src/Blowfish.c index f0d8594..8a6232f 100644 --- a/src/Blowfish.c +++ b/src/Blowfish.c @@ -26,8 +26,15 @@ * http://www.schneier.com/paper-blowfish-fse.html */ +#include "config.h" +#if HAVE_STDINT_H +# include <stdint.h> +#elif defined(__sun) || defined(__sun__) +# include <sys/inttypes.h> +#else +# error "stdint.h not found" +#endif #include <assert.h> -#include <stdint.h> #include <string.h> #include "Python.h" diff --git a/src/RIPEMD160.c b/src/RIPEMD160.c index 45b4a2c..692cb3e 100644 --- a/src/RIPEMD160.c +++ b/src/RIPEMD160.c @@ -43,8 +43,16 @@ * "RIPEMD-160 is big-bit-endian, little-byte-endian, and left-justified." */ +#include "config.h" +#if HAVE_STDINT_H +# include <stdint.h> +#elif defined(__sun) || defined(__sun__) +# include <sys/inttypes.h> +#else +# error "stdint.h not found" +#endif + #include <assert.h> -#include <stdint.h> #include <string.h> #include "Python.h" #include "pycrypto_compat.h" diff --git a/src/_counter.h b/src/_counter.h index 47dd494..fc3e24e 100644 --- a/src/_counter.h +++ b/src/_counter.h @@ -24,7 +24,14 @@ #ifndef PCT__COUNTER_H #define PCT__COUNTER_H -#include <stdint.h> +#include "config.h" +#if HAVE_STDINT_H +# include <stdint.h> +#elif defined(__sun) || defined(__sun__) +# include <sys/inttypes.h> +#else +# error "stdint.h not found" +#endif typedef struct { PyObject_HEAD diff --git a/src/inc-msvc/config.h b/src/inc-msvc/config.h index aa42a7b..2b7a626 100644 --- a/src/inc-msvc/config.h +++ b/src/inc-msvc/config.h @@ -11,3 +11,6 @@ /* Define to 1 if you have the `mpir' library (-lmpir). */ #undef HAVE_LIBMPIR + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 |