diff --git a/include/mgba/internal/gba/hardware.h b/include/mgba/internal/gba/hardware.h index 540a9fdf4..fab175538 100644 --- a/include/mgba/internal/gba/hardware.h +++ b/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 @@ struct GBARTC { uint8_t time[7]; }; #pragma pack(pop) +#else +struct GBATRC; +#endif struct GBAGBPKeyCallback { struct mKeyCallback d; diff --git a/src/platform/python/_builder.py b/src/platform/python/_builder.py index 43bcddc19..6b76ee698 100644 --- a/src/platform/python/_builder.py +++ b/src/platform/python/_builder.py @@ -65,6 +65,18 @@ for line in preprocessed.splitlines(): 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 = [] diff --git a/src/platform/python/setup.py b/src/platform/python/setup.py index e610f551f..c9030313c 100644 --- a/src/platform/python/setup.py +++ b/src/platform/python/setup.py @@ -21,8 +21,8 @@ setup( 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"],