GBA: Work around CFFI regression
Vicki Pfau vi@endrift.com
Tue, 04 Jun 2019 16:26:11 -0700
3 files changed,
18 insertions(+),
2 deletions(-)
M
include/mgba/internal/gba/hardware.h
→
include/mgba/internal/gba/hardware.h
@@ -66,6 +66,7 @@ DECL_BITS(RTCCommandData, Magic, 0, 4);
DECL_BITS(RTCCommandData, Command, 4, 3); DECL_BIT(RTCCommandData, Reading, 7); +#ifndef PYCPARSE #pragma pack(push, 1) struct GBARTC { int32_t bytesRemaining;@@ -78,6 +79,9 @@ RTCControl control;
uint8_t time[7]; }; #pragma pack(pop) +#else +struct GBATRC; +#endif struct GBAGBPKeyCallback { struct mKeyCallback d;
M
src/platform/python/_builder.py
→
src/platform/python/_builder.py
@@ -65,6 +65,18 @@ continue
lines.append(line) ffi.cdef('\n'.join(lines)) +ffi.cdef(""" +struct GBARTC { + int32_t bytesRemaining; + int32_t transferStep; + int32_t bitsRead; + int32_t bits; + int32_t commandActive; + RTCCommandData command; + RTCControl control; + uint8_t time[7]; +};""", packed=True) + preprocessed = subprocess.check_output(cpp + ["-fno-inline", "-P"] + cppflags + [os.path.join(pydir, "lib.h")], universal_newlines=True) lines = []
M
src/platform/python/setup.py
→
src/platform/python/setup.py
@@ -21,8 +21,8 @@ author="Jeffrey Pfau",
author_email="jeffrey@endrift.com", url="http://github.com/mgba-emu/mgba/", packages=["mgba"], - setup_requires=['cffi>=1.6,!=1.12.3', 'pytest-runner'], - install_requires=['cffi>=1.6,!=1.12.3', 'cached-property'], + setup_requires=['cffi>=1.6', 'pytest-runner'], + install_requires=['cffi>=1.6', 'cached-property'], extras_require={'pil': ['Pillow>=2.3'], 'cinema': ['pyyaml', 'pytest']}, tests_require=['pytest'], cffi_modules=["_builder.py:ffi"],