summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2013-02-17 11:39:05 -0800
committerDwayne Litzenberger <dlitz@dlitz.net>2013-02-17 11:39:49 -0800
commitd715685ae7f5a26ee90a23db5832e4243ce3af45 (patch)
treecb85ad0d86b0bf4c9e86a659d04e77bfd6031200
parente85ae486ab9b7ec1bee51431888283ac7a7fcaa2 (diff)
downloadpycrypto-d715685ae7f5a26ee90a23db5832e4243ce3af45.tar.gz
Fix compiler warning about "_POSIX_C_SOURCE" being redefined in string.h
The solution is to include Python.h before string.h is included.
-rw-r--r--src/AES.c2
-rw-r--r--src/ARC2.c2
-rw-r--r--src/Blowfish.c2
-rw-r--r--src/DES.c3
-rw-r--r--src/MD2.c2
-rw-r--r--src/MD4.c2
-rw-r--r--src/RIPEMD160.c3
-rw-r--r--src/_counter.c2
-rw-r--r--src/_fastmath.c2
-rw-r--r--src/block_template.c2
-rw-r--r--src/hash_SHA2.h2
-rw-r--r--src/hash_template.c2
-rw-r--r--src/stream_template.c2
13 files changed, 16 insertions, 12 deletions
diff --git a/src/AES.c b/src/AES.c
index 0aeaeda..9b125e2 100644
--- a/src/AES.c
+++ b/src/AES.c
@@ -24,9 +24,9 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include "Python.h"
#include <assert.h>
#include <stdlib.h>
-#include "Python.h"
#define MODULE_NAME _AES
#define BLOCK_SIZE 16
diff --git a/src/ARC2.c b/src/ARC2.c
index 49b5daf..a872823 100644
--- a/src/ARC2.c
+++ b/src/ARC2.c
@@ -41,8 +41,8 @@
*
*/
-#include <string.h>
#include "Python.h"
+#include <string.h>
#define MODULE_NAME _ARC2
#define BLOCK_SIZE 8
diff --git a/src/Blowfish.c b/src/Blowfish.c
index 94562bb..fd90fd7 100644
--- a/src/Blowfish.c
+++ b/src/Blowfish.c
@@ -26,6 +26,7 @@
* http://www.schneier.com/paper-blowfish-fse.html
*/
+#include "Python.h"
#include "config.h"
#if HAVE_STDINT_H
# include <stdint.h>
@@ -36,7 +37,6 @@
#endif
#include <assert.h>
#include <string.h>
-#include "Python.h"
#include "Blowfish-tables.h"
diff --git a/src/DES.c b/src/DES.c
index 96a9335..096e309 100644
--- a/src/DES.c
+++ b/src/DES.c
@@ -24,6 +24,8 @@
* Country of origin: Canada
*/
+#include "Python.h"
+
/* Setting this will cause LibTomCrypt to return CRYPT_INVALID_ARG when its
* assert-like LTC_ARGCHK macro fails. */
#define ARGTYPE 4
@@ -34,7 +36,6 @@
#undef DES /* this is needed because tomcrypt_custom.h defines DES to an empty string */
#include <assert.h>
-#include "Python.h"
typedef struct {
symmetric_key sk;
diff --git a/src/MD2.c b/src/MD2.c
index f670ec4..3543e21 100644
--- a/src/MD2.c
+++ b/src/MD2.c
@@ -27,8 +27,8 @@
*/
-#include <string.h>
#include "Python.h"
+#include <string.h>
#include "pycrypto_compat.h"
#define MODULE_NAME _MD2
diff --git a/src/MD4.c b/src/MD4.c
index 2c0a984..b08b095 100644
--- a/src/MD4.c
+++ b/src/MD4.c
@@ -27,8 +27,8 @@
*/
-#include <string.h>
#include "Python.h"
+#include <string.h>
#include "pycrypto_compat.h"
#define MODULE_NAME _MD4
diff --git a/src/RIPEMD160.c b/src/RIPEMD160.c
index 9786af8..8ff3fc5 100644
--- a/src/RIPEMD160.c
+++ b/src/RIPEMD160.c
@@ -43,6 +43,8 @@
* "RIPEMD-160 is big-bit-endian, little-byte-endian, and left-justified."
*/
+#include "Python.h"
+
#include "config.h"
#if HAVE_STDINT_H
# include <stdint.h>
@@ -54,7 +56,6 @@
#include <assert.h>
#include <string.h>
-#include "Python.h"
#include "pycrypto_compat.h"
#define RIPEMD160_DIGEST_SIZE 20
diff --git a/src/_counter.c b/src/_counter.c
index 9b396e4..a29b0ce 100644
--- a/src/_counter.c
+++ b/src/_counter.c
@@ -22,10 +22,10 @@
* ===================================================================
*/
+#include "Python.h"
#include <assert.h>
#include <stddef.h>
#include <string.h>
-#include "Python.h"
#include "pycrypto_compat.h"
#include "_counter.h"
diff --git a/src/_fastmath.c b/src/_fastmath.c
index 99b1c43..bd2651d 100644
--- a/src/_fastmath.c
+++ b/src/_fastmath.c
@@ -26,9 +26,9 @@
* $Id$
*/
+#include "Python.h"
#include <stdio.h>
#include <string.h>
-#include "Python.h"
#include "pycrypto_compat.h"
#include <longintrepr.h> /* for conversions */
#include "config.h"
diff --git a/src/block_template.c b/src/block_template.c
index c36b316..2cfee1b 100644
--- a/src/block_template.c
+++ b/src/block_template.c
@@ -24,6 +24,7 @@
* ===================================================================
*/
+#include "Python.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -33,7 +34,6 @@
#include <string.h>
#endif
-#include "Python.h"
#include "pycrypto_compat.h"
#include "modsupport.h"
diff --git a/src/hash_SHA2.h b/src/hash_SHA2.h
index 5867191..02991bd 100644
--- a/src/hash_SHA2.h
+++ b/src/hash_SHA2.h
@@ -26,6 +26,8 @@
#ifndef __HASH_SHA2_H
#define __HASH_SHA2_H
+#include "Python.h"
+
/* check if implementation set the correct macros */
#ifndef MODULE_NAME
#error SHA2 Implementation must define MODULE_NAME before including this header
diff --git a/src/hash_template.c b/src/hash_template.c
index eb27e9f..10b1b1c 100644
--- a/src/hash_template.c
+++ b/src/hash_template.c
@@ -24,13 +24,13 @@
/* Basic object type */
+#include "Python.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef _HAVE_STDC_HEADERS
#include <string.h>
#endif
-#include "Python.h"
#include "pycrypto_compat.h"
#define _STR(x) #x
diff --git a/src/stream_template.c b/src/stream_template.c
index c3effa4..a74d18d 100644
--- a/src/stream_template.c
+++ b/src/stream_template.c
@@ -24,6 +24,7 @@
* ===================================================================
*/
+#include "Python.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -33,7 +34,6 @@
#include <string.h>
#endif
-#include "Python.h"
#include "pycrypto_compat.h"
#include "modsupport.h"