[pypy-commit] pypy default: check for ARM using a flag like it is done for MSVC
bivab
noreply at buildbot.pypy.org
Sun Jun 16 21:51:19 CEST 2013
Author: David Schneider <david.schneider at picle.org>
Branch:
Changeset: r64897:b4b26fd9fe5b
Date: 2013-06-16 14:41 -0500
http://bitbucket.org/pypy/pypy/changeset/b4b26fd9fe5b/
Log: check for ARM using a flag like it is done for MSVC
diff --git a/pypy/module/_cffi_backend/newtype.py b/pypy/module/_cffi_backend/newtype.py
--- a/pypy/module/_cffi_backend/newtype.py
+++ b/pypy/module/_cffi_backend/newtype.py
@@ -116,14 +116,15 @@
# ____________________________________________________________
SF_MSVC_BITFIELDS = 1
+SF_GCC_ARM_BITFIELDS = 2
if sys.platform == 'win32':
DEFAULT_SFLAGS = SF_MSVC_BITFIELDS
+elif rffi_platform.getdefined('__arm__', ''):
+ DEFAULT_SFLAGS = SF_GCC_ARM_BITFIELDS
else:
DEFAULT_SFLAGS = 0
-_ARM = rffi_platform.getdefined('__arm__', '')
-
@unwrap_spec(name=str)
def new_struct_type(space, name):
return ctypestruct.W_CTypeStruct(space, name)
@@ -182,7 +183,7 @@
# field is an anonymous bitfield
falign = ftype.alignof()
do_align = True
- if fbitsize >= 0 and not _ARM:
+ if (sflags & SF_GCC_ARM_BITFIELDS) == 0 and fbitsize >= 0:
if (sflags & SF_MSVC_BITFIELDS) == 0:
# GCC: anonymous bitfields (of any size) don't cause alignment
do_align = (fname != '')
More information about the pypy-commit
mailing list