This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vladris
Recipients santoso.wijaya, terry.reedy, vladris
Date 2011-07-10.22:38:58
SpamBayes Score 7.6369406e-07
Marked as misclassified No
Message-id <1310337540.58.0.852653164775.issue12528@psf.upfronthosting.co.za>
In-reply-to
Content
Removed previously attached partial patch, this is complete patch.

Summary:
Added following 3 constants in ctypes:
ctypes.BITFIELD_ALLOCATION_NATIVE
ctypes.BITFIELD_ALLOCATION_GCC
ctypes.BITFIELD_ALLOCATION_MSVC

Setting _bitfield_allocation_ attribute to one of these on a class declaration inheriting from Structure will force specified allocation of the bitfield.

NATIVE is equivalent to not specifying anything. 
GCC will do GCC-style allocation (what Python does now on non-Windows)
MSVC will do MSVC-style allocation (what Python does now on Windows)

I added unittests to cover these and ran full suit on both Windows and Linux.

Still have to update documentation to mention this. Will submit diff for that after this gets reviewed.
History
Date User Action Args
2011-07-10 22:39:00vladrissetrecipients: + vladris, terry.reedy, santoso.wijaya
2011-07-10 22:39:00vladrissetmessageid: <1310337540.58.0.852653164775.issue12528@psf.upfronthosting.co.za>
2011-07-10 22:39:00vladrislinkissue12528 messages
2011-07-10 22:38:59vladriscreate