[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Make source build happily on Win32



Update of /home/minion/cvsroot/src/minion/src
In directory moria.mit.edu:/tmp/cvs-serv13642/src

Modified Files:
	_minionlib.h aes_ctr.c crypt.c fec.c main.c 
Log Message:
Make source build happily on Win32

Index: _minionlib.h
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/_minionlib.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- _minionlib.h	7 Jul 2003 23:46:51 -0000	1.15
+++ _minionlib.h	10 Jul 2003 18:39:15 -0000	1.16
@@ -19,6 +19,12 @@
 #include <rsa.h>
 #endif
 
+#ifdef _MSC_VER
+#define INLINE __inline
+#else
+#define INLINE inline
+#endif
+
 /* We provide our own implementation of counter mode; see aes_ctr.c
  */
 void mm_aes_counter128(const char *in, char *out, unsigned int len,

Index: aes_ctr.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/aes_ctr.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- aes_ctr.c	13 Feb 2003 10:56:40 -0000	1.13
+++ aes_ctr.c	10 Jul 2003 18:39:16 -0000	1.14
@@ -14,6 +14,8 @@
  *   a while before I decided to abandon it.
  */
 
+#include "_minionlib.h"
+
 #ifndef TRUNCATED_OPENSSL_INCLUDES
 #include <openssl/aes.h>
 #else
@@ -48,16 +50,16 @@
                          (((u32)ptr[2]) << 8) ^  \
                          (((u32)ptr[1]) << 16) ^ \
                          (((u32)ptr[0]) << 24))
-#define SET_U32_cp(ptr, i) { ptr[3] = (i)     & 0xff; \
-                             ptr[2] = (i>>8)  & 0xff; \
-                             ptr[1] = (i>>16) & 0xff; \
-                             ptr[0] = (i>>24) & 0xff; }
+#define SET_U32_cp(ptr, i) { ptr[3] = (u8)((i)     & 0xff); \
+                             ptr[2] = (u8)((i>>8)  & 0xff); \
+                             ptr[1] = (u8)((i>>16) & 0xff); \
+                             ptr[0] = (u8)((i>>24) & 0xff); }
 #define GET_U32(ptr)   GET_U32_cp(((u8*)(ptr)))
 #define SET_U32(ptr,i) SET_U32_cp(((u8*)(ptr)), i)
 #define INCR_U32(ptr, i) { i = GET_U32(ptr)+1; SET_U32(ptr,i); }
 #endif
 
-static inline void
+static INLINE void
 mm_incr(u32 const* ctr32)
 {
         u32 i;

Index: crypt.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/crypt.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- crypt.c	5 Jun 2003 18:41:41 -0000	1.24
+++ crypt.c	10 Jul 2003 18:39:16 -0000	1.25
@@ -23,7 +23,7 @@
 #include <pem.h>
 #include <evp.h>
 #endif
-#include <_minionlib.h>
+#include "_minionlib.h"
 #include <assert.h>
 
 #define TYPE_ERR(s) PyErr_SetString(PyExc_TypeError, s)

Index: fec.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/fec.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- fec.c	8 Jul 2003 19:13:50 -0000	1.5
+++ fec.c	10 Jul 2003 18:39:16 -0000	1.6
@@ -120,7 +120,7 @@
  * modnn(x) computes x % GF_SIZE, where GF_SIZE is 2**GF_BITS - 1,
  * without a slow divide.
  */
-static inline gf
+static INLINE gf
 modnn(int x)
 {
     while (x >= GF_SIZE) {
@@ -163,7 +163,7 @@
 	    gf_mul_table[0][j] = gf_mul_table[j][0] = 0;
 }
 #else	/* GF_BITS > 8 */
-static inline gf
+static INLINE gf
 gf_mul(x,y)
 {
     if ( (x) == 0 || (y)==0 ) return 0;
@@ -561,7 +561,7 @@
 #define FEC_MAGIC	0xFECC0DEC
 
 struct fec_parms {
-    u_long magic ;
+    unsigned long magic ;
     int k, n ;		/* parameters of the code */
     gf *enc_matrix ;
 } ;
@@ -786,7 +786,7 @@
 PyObject *mm_FECError = NULL;
 
 typedef struct mm_FEC {
-	PyObject_HEAD;
+	PyObject_HEAD
 	struct fec_parms *fec;
 } mm_FEC;	
 extern PyTypeObject mm_FEC_Type;

Index: main.c
===================================================================
RCS file: /home/minion/cvsroot/src/minion/src/main.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- main.c	7 Jul 2003 23:46:51 -0000	1.15
+++ main.c	10 Jul 2003 18:39:16 -0000	1.16
@@ -7,7 +7,7 @@
   "http://www.python.org/doc/current/ext/ext.html";.
 */
 
-#include <_minionlib.h>
+#include "_minionlib.h"
 
 #ifndef TRUNCATED_OPENSSL_INCLUDES
 #include <openssl/ssl.h>