[Python-checkins] r47236 - python/trunk/Modules/_ctypes/cfield.c

thomas.heller python-checkins at python.org
Wed Jul 5 11:13:57 CEST 2006


Author: thomas.heller
Date: Wed Jul  5 11:13:56 2006
New Revision: 47236

Modified:
   python/trunk/Modules/_ctypes/cfield.c
Log:
Fix the bitfield test when _ctypes is compiled with MingW.  Structures
containing bitfields may have different layout on MSVC and MingW .


Modified: python/trunk/Modules/_ctypes/cfield.c
==============================================================================
--- python/trunk/Modules/_ctypes/cfield.c	(original)
+++ python/trunk/Modules/_ctypes/cfield.c	Wed Jul  5 11:13:56 2006
@@ -65,10 +65,10 @@
 	}
 	if (bitsize /* this is a bitfield request */
 	    && *pfield_size /* we have a bitfield open */
-#ifdef MS_WIN32
+#if defined(MS_WIN32) && !defined(__MINGW32__)
 	    && dict->size * 8 == *pfield_size /* MSVC */
 #else
-	    && dict->size * 8 <= *pfield_size /* GCC */
+	    && dict->size * 8 <= *pfield_size /* GCC, MINGW */
 #endif
 	    && (*pbitofs + bitsize) <= *pfield_size) {
 		/* continue bit field */


More information about the Python-checkins mailing list