summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne C. Litzenberger <dlitz@dlitz.net>2011-10-10 23:33:38 -0400
committerDwayne C. Litzenberger <dlitz@dlitz.net>2011-10-10 23:37:51 -0400
commit7401e648d44f9324a313346f45e86fc5e779a7aa (patch)
treebe30ac9265b6ea5f8913aed1c6e9ace6eabe9216
parent323ce9ef951378dc96ce14c9e514e9aa19ab39d9 (diff)
downloadpycrypto-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--ACKS1
-rw-r--r--src/Blowfish.c9
-rw-r--r--src/RIPEMD160.c10
-rw-r--r--src/_counter.h9
-rw-r--r--src/inc-msvc/config.h3
5 files changed, 29 insertions, 3 deletions
diff --git a/ACKS b/ACKS
index 558fbd1..2c0d950 100644
--- a/ACKS
+++ b/ACKS
@@ -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