[Python-checkins] r79515 - in python/trunk: Lib/ctypes/test/test_win32.py Modules/_ctypes/callbacks.c Modules/_ctypes/callproc.c Modules/_ctypes/ctypes.h Modules/_ctypes/libffi_msvc/LICENSE Modules/_ctypes/libffi_msvc/README Modules/_ctypes/libffi_msvc/README.ctypes Modules/_ctypes/libffi_msvc/ffi.c Modules/_ctypes/libffi_msvc/ffi.h Modules/_ctypes/libffi_msvc/ffi_common.h Modules/_ctypes/libffi_msvc/fficonfig.h Modules/_ctypes/libffi_msvc/ffitarget.h Modules/_ctypes/libffi_msvc/prep_cif.c Modules/_ctypes/libffi_msvc/types.c Modules/_ctypes/libffi_msvc/win32.c Modules/_ctypes/libffi_msvc/win64.asm Modules/_ctypes/malloc_closure.c PCbuild/_ctypes.vcproj

thomas.heller python-checkins at python.org
Tue Mar 30 22:57:06 CEST 2010


Author: thomas.heller
Date: Tue Mar 30 22:57:06 2010
New Revision: 79515

Log:
Revert rev. 79509; ctypes doesn't build on linux.

Added:
   python/trunk/Modules/_ctypes/libffi_msvc/LICENSE
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/LICENSE
   python/trunk/Modules/_ctypes/libffi_msvc/README
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/README
   python/trunk/Modules/_ctypes/libffi_msvc/README.ctypes
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/README.ctypes
   python/trunk/Modules/_ctypes/libffi_msvc/ffi.c
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/ffi.c
   python/trunk/Modules/_ctypes/libffi_msvc/ffi_common.h
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/ffi_common.h
   python/trunk/Modules/_ctypes/libffi_msvc/ffitarget.h
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/ffitarget.h
   python/trunk/Modules/_ctypes/libffi_msvc/prep_cif.c
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/prep_cif.c
   python/trunk/Modules/_ctypes/libffi_msvc/types.c
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/types.c
   python/trunk/Modules/_ctypes/libffi_msvc/win32.c
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/win32.c
   python/trunk/Modules/_ctypes/libffi_msvc/win64.asm
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/libffi_msvc/win64.asm
   python/trunk/Modules/_ctypes/malloc_closure.c
      - copied unchanged from r79508, /python/trunk/Modules/_ctypes/malloc_closure.c
Modified:
   python/trunk/Lib/ctypes/test/test_win32.py
   python/trunk/Modules/_ctypes/callbacks.c
   python/trunk/Modules/_ctypes/callproc.c
   python/trunk/Modules/_ctypes/ctypes.h
   python/trunk/Modules/_ctypes/libffi_msvc/ffi.h
   python/trunk/Modules/_ctypes/libffi_msvc/fficonfig.h
   python/trunk/PCbuild/_ctypes.vcproj

Modified: python/trunk/Lib/ctypes/test/test_win32.py
==============================================================================
--- python/trunk/Lib/ctypes/test/test_win32.py	(original)
+++ python/trunk/Lib/ctypes/test/test_win32.py	Tue Mar 30 22:57:06 2010
@@ -6,6 +6,32 @@
 
 import _ctypes_test
 
+if sys.platform == "win32" and sizeof(c_void_p) == sizeof(c_int):
+    # Only windows 32-bit has different calling conventions.
+
+    class WindowsTestCase(unittest.TestCase):
+        def test_callconv_1(self):
+            # Testing stdcall function
+
+            IsWindow = windll.user32.IsWindow
+            # ValueError: Procedure probably called with not enough arguments (4 bytes missing)
+            self.assertRaises(ValueError, IsWindow)
+
+            # This one should succeeed...
+            self.assertEqual(0, IsWindow(0))
+
+            # ValueError: Procedure probably called with too many arguments (8 bytes in excess)
+            self.assertRaises(ValueError, IsWindow, 0, 0, 0)
+
+        def test_callconv_2(self):
+            # Calling stdcall function as cdecl
+
+            IsWindow = cdll.user32.IsWindow
+
+            # ValueError: Procedure called with not enough arguments (4 bytes missing)
+            # or wrong calling convention
+            self.assertRaises(ValueError, IsWindow, None)
+
 if sys.platform == "win32":
     class FunctionCallTestCase(unittest.TestCase):
 

Modified: python/trunk/Modules/_ctypes/callbacks.c
==============================================================================
--- python/trunk/Modules/_ctypes/callbacks.c	(original)
+++ python/trunk/Modules/_ctypes/callbacks.c	Tue Mar 30 22:57:06 2010
@@ -22,7 +22,7 @@
 	Py_XDECREF(self->callable);
 	Py_XDECREF(self->restype);
 	if (self->pcl)
-		ffi_closure_free(self->pcl);
+		_ctypes_free_closure(self->pcl);
 	PyObject_GC_Del(self);
 }
 
@@ -421,7 +421,8 @@
 
 	assert(CThunk_CheckExact(p));
 
-	if (ffi_closure_alloc(sizeof(ffi_closure), &p->pcl) == NULL) {
+	p->pcl = _ctypes_alloc_closure();
+	if (p->pcl == NULL) {
 		PyErr_NoMemory();
 		goto error;
 	}

Modified: python/trunk/Modules/_ctypes/callproc.c
==============================================================================
--- python/trunk/Modules/_ctypes/callproc.c	(original)
+++ python/trunk/Modules/_ctypes/callproc.c	Tue Mar 30 22:57:06 2010
@@ -771,6 +771,7 @@
 	ffi_cif cif;
 	int cc;
 #ifdef MS_WIN32
+	int delta;
 #ifndef DONT_USE_SEH
 	DWORD dwExceptionCode = 0;
 	EXCEPTION_RECORD record;
@@ -821,8 +822,9 @@
 #ifndef DONT_USE_SEH
 	__try {
 #endif
+		delta =
 #endif
-		ffi_call(&cif, (void *)pProc, resmem, avalues);
+			ffi_call(&cif, (void *)pProc, resmem, avalues);
 #ifdef MS_WIN32
 #ifndef DONT_USE_SEH
 	}
@@ -854,6 +856,35 @@
 		return -1;
 	}
 #endif
+#ifdef MS_WIN64
+	if (delta != 0) {
+		PyErr_Format(PyExc_RuntimeError,
+			     "ffi_call failed with code %d",
+			     delta);
+		return -1;
+	}
+#else
+	if (delta < 0) {
+		if (flags & FUNCFLAG_CDECL)
+			PyErr_Format(PyExc_ValueError,
+				     "Procedure called with not enough "
+				     "arguments (%d bytes missing) "
+				     "or wrong calling convention",
+				     -delta);
+		else
+			PyErr_Format(PyExc_ValueError,
+				     "Procedure probably called with not enough "
+				     "arguments (%d bytes missing)",
+				     -delta);
+		return -1;
+	} else if (delta > 0) {
+		PyErr_Format(PyExc_ValueError,
+			     "Procedure probably called with too many "
+			     "arguments (%d bytes in excess)",
+			     delta);
+		return -1;
+	}
+#endif
 #endif
 	if ((flags & FUNCFLAG_PYTHONAPI) && PyErr_Occurred())
 		return -1;
@@ -1130,7 +1161,11 @@
 	}
 	for (i = 0; i < argcount; ++i) {
 		atypes[i] = args[i].ffi_type;
-		if (atypes[i]->type == FFI_TYPE_STRUCT)
+		if (atypes[i]->type == FFI_TYPE_STRUCT 
+#ifdef _WIN64
+		    && atypes[i]->size <= sizeof(void *)
+#endif
+		    )
 			avalues[i] = (void *)args[i].value.p;
 		else
 			avalues[i] = (void *)&args[i].value;

Modified: python/trunk/Modules/_ctypes/ctypes.h
==============================================================================
--- python/trunk/Modules/_ctypes/ctypes.h	(original)
+++ python/trunk/Modules/_ctypes/ctypes.h	Tue Mar 30 22:57:06 2010
@@ -428,6 +428,9 @@
 #endif
 #endif
 
+extern void _ctypes_free_closure(void *);
+extern void *_ctypes_alloc_closure(void);
+
 extern void _ctypes_add_traceback(char *, char *, int);
 
 extern PyObject *PyCData_FromBaseObj(PyObject *type, PyObject *base, Py_ssize_t index, char *adr);

Modified: python/trunk/Modules/_ctypes/libffi_msvc/ffi.h
==============================================================================
--- python/trunk/Modules/_ctypes/libffi_msvc/ffi.h	(original)
+++ python/trunk/Modules/_ctypes/libffi_msvc/ffi.h	Tue Mar 30 22:57:06 2010
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------*-C-*-
-   libffi @VERSION@ - Copyright (c) 1996-2003, 2007, 2008  Red Hat, Inc.
+   libffi 2.00-beta - Copyright (c) 1996-2003  Red Hat, Inc.
 
    Permission is hereby granted, free of charge, to any person obtaining
    a copy of this software and associated documentation files (the
@@ -12,14 +12,13 @@
    The above copyright notice and this permission notice shall be included
    in all copies or substantial portions of the Software.
 
-   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
+   THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+   IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+   OTHER DEALINGS IN THE SOFTWARE.
 
    ----------------------------------------------------------------------- */
 
@@ -57,7 +56,7 @@
 #endif
 
 /* Specify which architecture libffi is configured for. */
-/* #define @TARGET@ */
+//XXX #define X86
 
 /* ---- System configuration information --------------------------------- */
 
@@ -65,10 +64,6 @@
 
 #ifndef LIBFFI_ASM
 
-#ifdef _MSC_VER
-#define __attribute__(X)
-#endif
-
 #include <stddef.h>
 #include <limits.h>
 
@@ -84,21 +79,12 @@
 #  ifdef __GNUC__
 #   define FFI_LONG_LONG_MAX __LONG_LONG_MAX__
 #  endif
+#  ifdef _MSC_VER
+#   define FFI_LONG_LONG_MAX _I64_MAX
+#  endif
 # endif
 #endif
 
-/* The closure code assumes that this works on pointers, i.e. a size_t	*/
-/* can hold a pointer.							*/
-
-typedef struct _ffi_type
-{
-  size_t size;
-  unsigned short alignment;
-  unsigned short type;
-  struct _ffi_type **elements;
-} ffi_type;
-
-#ifndef LIBFFI_HIDE_BASIC_TYPES
 #if SCHAR_MAX == 127
 # define ffi_type_uchar                ffi_type_uint8
 # define ffi_type_schar                ffi_type_sint8
@@ -129,23 +115,26 @@
  #error "int size not supported"
 #endif
 
+#define ffi_type_ulong         ffi_type_uint64
+#define ffi_type_slong         ffi_type_sint64
 #if LONG_MAX == 2147483647
 # if FFI_LONG_LONG_MAX != 9223372036854775807
- #error "no 64-bit data type supported"
+  #error "no 64-bit data type supported"
 # endif
 #elif LONG_MAX != 9223372036854775807
  #error "long size not supported"
 #endif
 
-#if LONG_MAX == 2147483647
-# define ffi_type_ulong        ffi_type_uint32
-# define ffi_type_slong        ffi_type_sint32
-#elif LONG_MAX == 9223372036854775807
-# define ffi_type_ulong        ffi_type_uint64
-# define ffi_type_slong        ffi_type_sint64
-#else
- #error "long size not supported"
-#endif
+/* The closure code assumes that this works on pointers, i.e. a size_t	*/
+/* can hold a pointer.							*/
+
+typedef struct _ffi_type
+{
+  size_t size;
+  unsigned short alignment;
+  unsigned short type;
+  /*@null@*/ struct _ffi_type **elements;
+} ffi_type;
 
 /* These are defined in types.c */
 extern ffi_type ffi_type_void;
@@ -159,19 +148,14 @@
 extern ffi_type ffi_type_sint64;
 extern ffi_type ffi_type_float;
 extern ffi_type ffi_type_double;
+extern ffi_type ffi_type_longdouble;
 extern ffi_type ffi_type_pointer;
 
-#if HAVE_LONG_DOUBLE
-extern ffi_type ffi_type_longdouble;
-#else
-#define ffi_type_longdouble ffi_type_double
-#endif
-#endif /* LIBFFI_HIDE_BASIC_TYPES */
 
 typedef enum {
   FFI_OK = 0,
   FFI_BAD_TYPEDEF,
-  FFI_BAD_ABI
+  FFI_BAD_ABI 
 } ffi_status;
 
 typedef unsigned FFI_TYPE;
@@ -179,8 +163,8 @@
 typedef struct {
   ffi_abi abi;
   unsigned nargs;
-  ffi_type **arg_types;
-  ffi_type *rtype;
+  /*@dependent@*/ ffi_type **arg_types;
+  /*@dependent@*/ ffi_type *rtype;
   unsigned bytes;
   unsigned flags;
 #ifdef FFI_EXTRA_CIF_FIELDS
@@ -190,16 +174,10 @@
 
 /* ---- Definitions for the raw API -------------------------------------- */
 
-#ifndef FFI_SIZEOF_ARG
-# if LONG_MAX == 2147483647
-#  define FFI_SIZEOF_ARG        4
-# elif LONG_MAX == 9223372036854775807
-#  define FFI_SIZEOF_ARG        8
-# endif
-#endif
-
-#ifndef FFI_SIZEOF_JAVA_RAW
-#  define FFI_SIZEOF_JAVA_RAW FFI_SIZEOF_ARG
+#ifdef _WIN64
+#define FFI_SIZEOF_ARG 8
+#else
+#define FFI_SIZEOF_ARG 4
 #endif
 
 typedef union {
@@ -210,25 +188,10 @@
   void*     ptr;
 } ffi_raw;
 
-#if FFI_SIZEOF_JAVA_RAW == 4 && FFI_SIZEOF_ARG == 8
-/* This is a special case for mips64/n32 ABI (and perhaps others) where
-   sizeof(void *) is 4 and FFI_SIZEOF_ARG is 8.  */
-typedef union {
-  signed int	sint;
-  unsigned int	uint;
-  float		flt;
-  char		data[FFI_SIZEOF_JAVA_RAW];
-  void*		ptr;
-} ffi_java_raw;
-#else
-typedef ffi_raw ffi_java_raw;
-#endif
-
-
-void ffi_raw_call (ffi_cif *cif,
-		   void (*fn)(void),
-		   void *rvalue,
-		   ffi_raw *avalue);
+void ffi_raw_call (/*@dependent@*/ ffi_cif *cif, 
+		   void (*fn)(), 
+		   /*@out@*/ void *rvalue, 
+		   /*@dependent@*/ ffi_raw *avalue);
 
 void ffi_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
 void ffi_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
@@ -238,35 +201,25 @@
 /* packing, even on 64-bit machines.  I.e. on 64-bit machines		*/
 /* longs and doubles are followed by an empty 64-bit word.		*/
 
-void ffi_java_raw_call (ffi_cif *cif,
-			void (*fn)(void),
-			void *rvalue,
-			ffi_java_raw *avalue);
+void ffi_java_raw_call (/*@dependent@*/ ffi_cif *cif, 
+		        void (*fn)(), 
+		        /*@out@*/ void *rvalue, 
+		        /*@dependent@*/ ffi_raw *avalue);
 
-void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw);
-void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_java_raw *raw, void **args);
+void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_raw *raw);
+void ffi_java_raw_to_ptrarray (ffi_cif *cif, ffi_raw *raw, void **args);
 size_t ffi_java_raw_size (ffi_cif *cif);
 
 /* ---- Definitions for closures ----------------------------------------- */
 
 #if FFI_CLOSURES
 
-#ifdef _MSC_VER
-__declspec(align(8))
-#endif
 typedef struct {
   char tramp[FFI_TRAMPOLINE_SIZE];
   ffi_cif   *cif;
   void     (*fun)(ffi_cif*,void*,void**,void*);
   void      *user_data;
-#ifdef __GNUC__
-} ffi_closure __attribute__((aligned (8)));
-#else
 } ffi_closure;
-#endif
-
-void *ffi_closure_alloc (size_t size, void **code);
-void ffi_closure_free (void *);
 
 ffi_status
 ffi_prep_closure (ffi_closure*,
@@ -274,13 +227,6 @@
 		  void (*fun)(ffi_cif*,void*,void**,void*),
 		  void *user_data);
 
-ffi_status
-ffi_prep_closure_loc (ffi_closure*,
-		      ffi_cif *,
-		      void (*fun)(ffi_cif*,void*,void**,void*),
-		      void *user_data,
-		      void*codeloc);
-
 typedef struct {
   char tramp[FFI_TRAMPOLINE_SIZE];
 
@@ -302,27 +248,6 @@
 
 } ffi_raw_closure;
 
-typedef struct {
-  char tramp[FFI_TRAMPOLINE_SIZE];
-
-  ffi_cif   *cif;
-
-#if !FFI_NATIVE_RAW_API
-
-  /* if this is enabled, then a raw closure has the same layout 
-     as a regular closure.  We use this to install an intermediate 
-     handler to do the transaltion, void** -> ffi_raw*. */
-
-  void     (*translate_args)(ffi_cif*,void*,void**,void*);
-  void      *this_closure;
-
-#endif
-
-  void     (*fun)(ffi_cif*,void*,ffi_java_raw*,void*);
-  void      *user_data;
-
-} ffi_java_raw_closure;
-
 ffi_status
 ffi_prep_raw_closure (ffi_raw_closure*,
 		      ffi_cif *cif,
@@ -330,42 +255,29 @@
 		      void *user_data);
 
 ffi_status
-ffi_prep_raw_closure_loc (ffi_raw_closure*,
-			  ffi_cif *cif,
-			  void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
-			  void *user_data,
-			  void *codeloc);
-
-ffi_status
-ffi_prep_java_raw_closure (ffi_java_raw_closure*,
+ffi_prep_java_raw_closure (ffi_raw_closure*,
 		           ffi_cif *cif,
-		           void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
+		           void (*fun)(ffi_cif*,void*,ffi_raw*,void*),
 		           void *user_data);
 
-ffi_status
-ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
-			       ffi_cif *cif,
-			       void (*fun)(ffi_cif*,void*,ffi_java_raw*,void*),
-			       void *user_data,
-			       void *codeloc);
-
 #endif /* FFI_CLOSURES */
 
 /* ---- Public interface definition -------------------------------------- */
 
-ffi_status ffi_prep_cif(ffi_cif *cif,
+ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif, 
 			ffi_abi abi,
-			unsigned int nargs,
-			ffi_type *rtype,
-			ffi_type **atypes);
-
-void ffi_call(ffi_cif *cif,
-	      void (*fn)(void),
-	      void *rvalue,
-	      void **avalue);
+			unsigned int nargs, 
+			/*@dependent@*/ /*@out@*/ /*@partial@*/ ffi_type *rtype, 
+			/*@dependent@*/ ffi_type **atypes);
+
+int
+ffi_call(/*@dependent@*/ ffi_cif *cif, 
+	 void (*fn)(), 
+	 /*@out@*/ void *rvalue, 
+	 /*@dependent@*/ void **avalue);
 
 /* Useful for eliminating compiler warnings */
-#define FFI_FN(f) ((void (*)(void))f)
+#define FFI_FN(f) ((void (*)())f)
 
 /* ---- Definitions shared with assembly code ---------------------------- */
 
@@ -376,7 +288,7 @@
 #define FFI_TYPE_INT        1
 #define FFI_TYPE_FLOAT      2    
 #define FFI_TYPE_DOUBLE     3
-#if HAVE_LONG_DOUBLE
+#if 1
 #define FFI_TYPE_LONGDOUBLE 4
 #else
 #define FFI_TYPE_LONGDOUBLE FFI_TYPE_DOUBLE
@@ -400,3 +312,4 @@
 #endif
 
 #endif
+

Modified: python/trunk/Modules/_ctypes/libffi_msvc/fficonfig.h
==============================================================================
--- python/trunk/Modules/_ctypes/libffi_msvc/fficonfig.h	(original)
+++ python/trunk/Modules/_ctypes/libffi_msvc/fficonfig.h	Tue Mar 30 22:57:06 2010
@@ -1,186 +1,96 @@
 /* fficonfig.h.  Originally created by configure, now hand_maintained for MSVC. */
 
-/* fficonfig.h.in.  Generated from configure.ac by autoheader.  */
+/* fficonfig.h.  Generated automatically by configure.  */
+/* fficonfig.h.in.  Generated automatically from configure.in by autoheader.  */
 
-/* Define if building universal (internal helper macro) */
-/* #undef AC_APPLE_UNIVERSAL_BUILD */
+/* Define this for MSVC, but not for mingw32! */
+#ifdef _MSC_VER
+#define __attribute__(x) /* */
+#endif
+#define alloca _alloca
 
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-/* #undef CRAY_STACKSEG_END */
+/*----------------------------------------------------------------*/
 
-/* Define to 1 if using `alloca.c'. */
+/* Define if using alloca.c.  */
 /* #undef C_ALLOCA */
 
-/* Define to the flags needed for the .section .eh_frame directive. */
-/* #undef EH_FRAME_FLAGS */
-
-/* Define this if you want extra debugging. */
-/* #undef FFI_DEBUG */
-
-/* Cannot use malloc on this target, so, we revert to alternative means */
-/* #undef FFI_MMAP_EXEC_WRIT */
-
-/* Define this is you do not want support for the raw API. */
-#define FFI_NO_RAW_API 1
-
-/* Define this is you do not want support for aggregate types. */
-/* #undef FFI_NO_STRUCTS */
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+   This function is required for alloca.c support on those systems.  */
+/* #undef CRAY_STACKSEG_END */
 
-/* Define to 1 if you have `alloca', as a function or macro. */
+/* Define if you have alloca, as a function or macro.  */
 #define HAVE_ALLOCA 1
 
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
-/* #undef HAVE_ALLOCA_H */
-
-/* Define if your assembler supports .cfi_* directives. */
-/* #undef HAVE_AS_CFI_PSEUDO_OP */
+/* Define if you have <alloca.h> and it should be used (not on Ultrix).  */
+/* #define HAVE_ALLOCA_H 1 */
 
-/* Define if your assembler supports .register. */
-/* #undef HAVE_AS_REGISTER_PSEUDO_OP */
-
-/* Define if your assembler and linker support unaligned PC relative relocs.
-   */
-/* #undef HAVE_AS_SPARC_UA_PCREL */
-
-/* Define if your assembler supports PC relative relocs. */
-/* #undef HAVE_AS_X86_PCREL */
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-/* #undef HAVE_DLFCN_H */
-
-/* Define if __attribute__((visibility("hidden"))) is supported. */
-/* #undef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE */
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-/* #undef HAVE_INTTYPES_H */
+/* If using the C implementation of alloca, define if you know the
+   direction of stack growth for your system; otherwise it will be
+   automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+/* #undef STACK_DIRECTION */
 
-/* Define if you have the long double type and it is bigger than a double */
-/* #undef HAVE_LONG_DOUBLE */
+/* Define if you have the ANSI C header files.  */
+#define STDC_HEADERS 1
 
-/* Define to 1 if you have the `memcpy' function. */
+/* Define if you have the memcpy function.  */
 #define HAVE_MEMCPY 1
 
-/* Define to 1 if you have the <memory.h> header file. */
-/* #undef HAVE_MEMORY_H */
-
-/* Define to 1 if you have the `mmap' function. */
-/* #undef HAVE_MMAP */
-
-/* Define if mmap with MAP_ANON(YMOUS) works. */
-/* #undef HAVE_MMAP_ANON */
-
-/* Define if mmap of /dev/zero works. */
-/* #undef HAVE_MMAP_DEV_ZERO */
-
 /* Define if read-only mmap of a plain file works. */
-/* #undef HAVE_MMAP_FILE */
-
-/* Define if .eh_frame sections should be read-only. */
-/* #undef HAVE_RO_EH_FRAME */
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+//#define HAVE_MMAP_FILE 1
 
-/* Define to 1 if you have the <sys/mman.h> header file. */
-/* #undef HAVE_SYS_MMAN_H */
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-/* #undef HAVE_SYS_STAT_H */
+/* Define if mmap of /dev/zero works. */
+//#define HAVE_MMAP_DEV_ZERO 1
 
-/* Define to 1 if you have the <sys/types.h> header file. */
-/* #undef HAVE_SYS_TYPES_H */
+/* Define if mmap with MAP_ANON(YMOUS) works. */
+//#define HAVE_MMAP_ANON 1
 
-/* Define to 1 if you have the <unistd.h> header file. */
-/* #undef HAVE_UNISTD_H */
+/* The number of bytes in type double */
+#define SIZEOF_DOUBLE 8
 
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-/* #undef LT_OBJDIR */
+/* The number of bytes in type long double */
+#define SIZEOF_LONG_DOUBLE 12
 
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-/* #undef NO_MINUS_C_MINUS_O */
+/* Define if you have the long double type and it is bigger than a double */
+#define HAVE_LONG_DOUBLE 1
 
-/* Name of package */
-/* #undef PACKAGE */
+/* whether byteorder is bigendian */
+/* #undef WORDS_BIGENDIAN */
 
-/* Define to the address where bug reports for this package should be sent. */
-/* #undef PACKAGE_BUGREPORT */
+/* Define if the host machine stores words of multi-word integers in
+   big-endian order. */
+/* #undef HOST_WORDS_BIG_ENDIAN */
 
-/* Define to the full name of this package. */
-/* #undef PACKAGE_NAME */
+/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
+#define BYTEORDER 1234
 
-/* Define to the full name and version of this package. */
-/* #undef PACKAGE_STRING */
+/* Define if your assembler and linker support unaligned PC relative relocs. */
+/* #undef HAVE_AS_SPARC_UA_PCREL */
 
-/* Define to the one symbol short name of this package. */
-/* #undef PACKAGE_TARNAME */
+/* Define if your assembler supports .register. */
+/* #undef HAVE_AS_REGISTER_PSEUDO_OP */
 
-/* Define to the home page for this package. */
-/* #undef PACKAGE_URL */
+/* Define if .eh_frame sections should be read-only. */
+/* #undef HAVE_RO_EH_FRAME */
 
-/* Define to the version of this package. */
-/* #undef PACKAGE_VERSION */
+/* Define to the flags needed for the .section .eh_frame directive. */
+/* #define EH_FRAME_FLAGS "aw" */
 
-/* The size of `double', as computed by sizeof. */
-#define SIZEOF_DOUBLE 8
+/* Define to the flags needed for the .section .eh_frame directive. */
+/* #define EH_FRAME_FLAGS "aw" */
 
-/* The size of `long double', as computed by sizeof. */
-#undef SIZEOF_LONG_DOUBLE
+/* Define this if you want extra debugging. */
+/* #undef FFI_DEBUG */
 
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
-	STACK_DIRECTION > 0 => grows toward higher addresses
-	STACK_DIRECTION < 0 => grows toward lower addresses
-	STACK_DIRECTION = 0 => direction of growth unknown */
-/* #undef STACK_DIRECTION */
+/* Define this is you do not want support for aggregate types. */
+/* #undef FFI_NO_STRUCTS */
 
-/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
+/* Define this is you do not want support for the raw API. */
+/* #undef FFI_NO_RAW_API */
 
-/* Define this if you are using Purify and want to suppress spurious messages.
-   */
+/* Define this if you are using Purify and want to suppress spurious messages. */
 /* #undef USING_PURIFY */
 
-/* Version number of package */
-/* #undef VERSION */
-
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
-   significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-#  define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-#  undef WORDS_BIGENDIAN
-# endif
-#endif
-
-
-#ifdef HAVE_HIDDEN_VISIBILITY_ATTRIBUTE
-#ifdef LIBFFI_ASM
-#define FFI_HIDDEN(name) .hidden name
-#else
-#define FFI_HIDDEN __attribute__ ((visibility ("hidden")))
-#endif
-#else
-#ifdef LIBFFI_ASM
-#define FFI_HIDDEN(name)
-#else
-#define FFI_HIDDEN
-#endif
-#endif
-

Modified: python/trunk/PCbuild/_ctypes.vcproj
==============================================================================
--- python/trunk/PCbuild/_ctypes.vcproj	(original)
+++ python/trunk/PCbuild/_ctypes.vcproj	Tue Mar 30 22:57:06 2010
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
 	ProjectType="Visual C++"
-	Version="9,00"
+	Version="9.00"
 	Name="_ctypes"
 	ProjectGUID="{0E9791DB-593A-465F-98BC-681011311618}"
 	RootNamespace="_ctypes"
@@ -42,8 +42,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc;..\Modules\_ctypes\libffi\include;..\Modules\_ctypes\libffi\src\x86"
-				PreprocessorDefinitions="X86_WIN32"
+				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -104,8 +103,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc;..\Modules\_ctypes\libffi\include;..\Modules\_ctypes\libffi\src\x86"
-				PreprocessorDefinitions="X86_WIN64"
+				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -166,8 +164,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc;..\Modules\_ctypes\libffi\include;..\Modules\_ctypes\libffi\src\x86"
-				PreprocessorDefinitions="X86_WIN32"
+				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -231,8 +228,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc;..\Modules\_ctypes\libffi\include;..\Modules\_ctypes\libffi\src\x86"
-				PreprocessorDefinitions="X86_WIN64"
+				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -295,8 +291,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc;..\Modules\_ctypes\libffi\include;..\Modules\_ctypes\libffi\src\x86"
-				PreprocessorDefinitions="X86_WIN32"
+				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -360,8 +355,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc;..\Modules\_ctypes\libffi\include;..\Modules\_ctypes\libffi\src\x86"
-				PreprocessorDefinitions="X86_WIN64"
+				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -425,8 +419,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc;..\Modules\_ctypes\libffi\include;..\Modules\_ctypes\libffi\src\x86"
-				PreprocessorDefinitions="X86_WIN32"
+				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -490,8 +483,7 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc;..\Modules\_ctypes\libffi\include;..\Modules\_ctypes\libffi\src\x86"
-				PreprocessorDefinitions="X86_WIN64"
+				AdditionalIncludeDirectories="..\Modules\_ctypes\libffi_msvc"
 			/>
 			<Tool
 				Name="VCManagedResourceCompilerTool"
@@ -551,7 +543,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\_ctypes\libffi\include\ffi_common.h"
+				RelativePath="..\Modules\_ctypes\libffi_msvc\ffi_common.h"
 				>
 			</File>
 			<File
@@ -559,7 +551,7 @@
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\_ctypes\libffi\src\x86\ffitarget.h"
+				RelativePath="..\Modules\_ctypes\libffi_msvc\ffitarget.h"
 				>
 			</File>
 		</Filter>
@@ -583,23 +575,15 @@
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\_ctypes\libffi\src\closures.c"
+				RelativePath="..\Modules\_ctypes\libffi_msvc\ffi.c"
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\_ctypes\libffi\src\x86\ffi.c"
+				RelativePath="..\Modules\_ctypes\malloc_closure.c"
 				>
-				<FileConfiguration
-					Name="Debug|x64"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-						PreprocessorDefinitions="X86_WIN64"
-					/>
-				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\Modules\_ctypes\libffi\src\prep_cif.c"
+				RelativePath="..\Modules\_ctypes\libffi_msvc\prep_cif.c"
 				>
 			</File>
 			<File
@@ -607,32 +591,14 @@
 				>
 			</File>
 			<File
-				RelativePath="..\Modules\_ctypes\libffi\src\x86\win32.S"
+				RelativePath="..\Modules\_ctypes\libffi_msvc\win32.c"
 				>
 				<FileConfiguration
-					Name="Debug|Win32"
-					>
-					<Tool
-						Name="VCCustomBuildTool"
-						CommandLine="cl /nologo /EP /I ..\Modules\_ctypes\libffi_msvc /I ..\Modules\_ctypes\libffi\src\x86 $(InputPath) &gt; $(IntDir)$(InputName).asm&#x0D;&#x0A;ml /nologo /Zi /c /Fo $(IntDir)$(InputName).obj $(IntDir)$(InputName).asm&#x0D;&#x0A;"
-						Outputs="$(IntDir)$(InputName).obj"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
 					Name="Debug|x64"
 					ExcludedFromBuild="true"
 					>
 					<Tool
-						Name="VCCustomBuildTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					>
-					<Tool
-						Name="VCCustomBuildTool"
-						CommandLine="cl /nologo /EP /I ..\Modules\_ctypes\libffi_msvc /I ..\Modules\_ctypes\libffi\src\x86 $(InputPath) &gt; $(IntDir)$(InputName).asm&#x0D;&#x0A;ml /nologo /c /Fo $(IntDir)$(InputName).obj $(IntDir)$(InputName).asm&#x0D;&#x0A;"
-						Outputs="$(IntDir)$(InputName).obj"
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
@@ -640,16 +606,7 @@
 					ExcludedFromBuild="true"
 					>
 					<Tool
-						Name="VCCustomBuildTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="PGInstrument|Win32"
-					>
-					<Tool
-						Name="VCCustomBuildTool"
-						CommandLine="cl /nologo /EP /I ..\Modules\_ctypes\libffi_msvc /I ..\Modules\_ctypes\libffi\src\x86 $(InputPath) &gt; $(IntDir)$(InputName).asm&#x0D;&#x0A;ml /nologo /Zi /c /Fo $(IntDir)$(InputName).obj $(IntDir)$(InputName).asm&#x0D;&#x0A;"
-						Outputs="$(IntDir)$(InputName).obj"
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
@@ -657,16 +614,7 @@
 					ExcludedFromBuild="true"
 					>
 					<Tool
-						Name="VCCustomBuildTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="PGUpdate|Win32"
-					>
-					<Tool
-						Name="VCCustomBuildTool"
-						CommandLine="cl /nologo /EP /I ..\Modules\_ctypes\libffi_msvc /I ..\Modules\_ctypes\libffi\src\x86 $(InputPath) &gt; $(IntDir)$(InputName).asm&#x0D;&#x0A;ml /nologo /Zi /c /Fo $(IntDir)$(InputName).obj $(IntDir)$(InputName).asm&#x0D;&#x0A;"
-						Outputs="$(IntDir)$(InputName).obj"
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
@@ -674,12 +622,12 @@
 					ExcludedFromBuild="true"
 					>
 					<Tool
-						Name="VCCustomBuildTool"
+						Name="VCCLCompilerTool"
 					/>
 				</FileConfiguration>
 			</File>
 			<File
-				RelativePath="..\Modules\_ctypes\libffi\src\x86\win64.S"
+				RelativePath="..\Modules\_ctypes\libffi_msvc\win64.asm"
 				>
 				<FileConfiguration
 					Name="Debug|Win32"
@@ -694,8 +642,8 @@
 					>
 					<Tool
 						Name="VCCustomBuildTool"
-						CommandLine="cl /nologo /EP /I ..\Modules\_ctypes\libffi_msvc /I ..\Modules\_ctypes\libffi\src\x86 $(InputPath) &gt; $(IntDir)$(InputName).asm&#x0D;&#x0A;ml64 /Zi /nologo /c /Fo $(IntDir)$(InputName).obj $(IntDir)$(InputName).asm&#x0D;&#x0A;"
-						Outputs="$(IntDir)$(InputName).obj"
+						CommandLine="ml64 /nologo /c /Zi /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+						Outputs="$(IntDir)\win64.obj"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
@@ -711,8 +659,8 @@
 					>
 					<Tool
 						Name="VCCustomBuildTool"
-						CommandLine="cl /nologo /EP /I ..\Modules\_ctypes\libffi_msvc /I ..\Modules\_ctypes\libffi\src\x86 $(InputPath) &gt; $(IntDir)$(InputName).asm&#x0D;&#x0A;ml64 /nologo /c /Fo $(IntDir)$(InputName).obj $(IntDir)$(InputName).asm&#x0D;&#x0A;"
-						Outputs="$(IntDir)$(InputName).obj"
+						CommandLine="ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+						Outputs="$(IntDir)\win64.obj"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
@@ -728,8 +676,8 @@
 					>
 					<Tool
 						Name="VCCustomBuildTool"
-						CommandLine="cl /nologo /EP /I ..\Modules\_ctypes\libffi_msvc /I ..\Modules\_ctypes\libffi\src\x86 $(InputPath) &gt; $(IntDir)$(InputName).asm&#x0D;&#x0A;ml64 /nologo /c /Fo $(IntDir)$(InputName).obj $(IntDir)$(InputName).asm&#x0D;&#x0A;"
-						Outputs="$(IntDir)$(InputName).obj"
+						CommandLine="ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+						Outputs="$(IntDir)\win64.obj"
 					/>
 				</FileConfiguration>
 				<FileConfiguration
@@ -745,8 +693,8 @@
 					>
 					<Tool
 						Name="VCCustomBuildTool"
-						CommandLine="cl /nologo /EP /I ..\Modules\_ctypes\libffi_msvc /I ..\Modules\_ctypes\libffi\src\x86 $(InputPath) &gt; $(IntDir)$(InputName).asm&#x0D;&#x0A;ml64 /nologo /c /Fo $(IntDir)$(InputName).obj $(IntDir)$(InputName).asm&#x0D;&#x0A;"
-						Outputs="$(IntDir)$(InputName).obj"
+						CommandLine="ml64 /nologo /c /Fo &quot;$(IntDir)\win64.obj&quot; &quot;$(InputPath)&quot;&#x0D;&#x0A;"
+						Outputs="$(IntDir)\win64.obj"
 					/>
 				</FileConfiguration>
 			</File>


More information about the Python-checkins mailing list