diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-03-16 09:07:26 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-03-16 09:07:26 (GMT) |
commit | fda33559dcad6f9595eefec8afc326e5ac0c81c5 (patch) | |
tree | 5dfc87ec636c9fb5f18d44f222be0c75393e8f09 /Modules | |
parent | 790bf0db77da018376b50c70b68a48a4a81cf444 (diff) | |
download | cpython-fda33559dcad6f9595eefec8afc326e5ac0c81c5.zip cpython-fda33559dcad6f9595eefec8afc326e5ac0c81c5.tar.gz cpython-fda33559dcad6f9595eefec8afc326e5ac0c81c5.tar.bz2 |
fix ctypes test alignment assumptions (closes #20946)
Patch by Andreas Schwab.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ctypes/cfield.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 65772cf..79d60f3 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -1640,9 +1640,9 @@ typedef struct { char c; void *x; } s_void_p; /* #define CHAR_ALIGN (sizeof(s_char) - sizeof(char)) #define SHORT_ALIGN (sizeof(s_short) - sizeof(short)) -#define INT_ALIGN (sizeof(s_int) - sizeof(int)) #define LONG_ALIGN (sizeof(s_long) - sizeof(long)) */ +#define INT_ALIGN (sizeof(s_int) - sizeof(int)) #define FLOAT_ALIGN (sizeof(s_float) - sizeof(float)) #define DOUBLE_ALIGN (sizeof(s_double) - sizeof(double)) #define LONGDOUBLE_ALIGN (sizeof(s_long_double) - sizeof(long double)) @@ -1684,8 +1684,8 @@ ffi_type ffi_type_sint8 = { 1, 1, FFI_TYPE_SINT8 }; ffi_type ffi_type_uint16 = { 2, 2, FFI_TYPE_UINT16 }; ffi_type ffi_type_sint16 = { 2, 2, FFI_TYPE_SINT16 }; -ffi_type ffi_type_uint32 = { 4, 4, FFI_TYPE_UINT32 }; -ffi_type ffi_type_sint32 = { 4, 4, FFI_TYPE_SINT32 }; +ffi_type ffi_type_uint32 = { 4, INT_ALIGN, FFI_TYPE_UINT32 }; +ffi_type ffi_type_sint32 = { 4, INT_ALIGN, FFI_TYPE_SINT32 }; ffi_type ffi_type_uint64 = { 8, LONG_LONG_ALIGN, FFI_TYPE_UINT64 }; ffi_type ffi_type_sint64 = { 8, LONG_LONG_ALIGN, FFI_TYPE_SINT64 }; |