mirror of https://github.com/mgba-emu/mgba.git
GBA: Work around CFFI regression
This commit is contained in:
parent
4787eb29c5
commit
5c11ea8c27
|
@ -66,6 +66,7 @@ DECL_BITS(RTCCommandData, Magic, 0, 4);
|
||||||
DECL_BITS(RTCCommandData, Command, 4, 3);
|
DECL_BITS(RTCCommandData, Command, 4, 3);
|
||||||
DECL_BIT(RTCCommandData, Reading, 7);
|
DECL_BIT(RTCCommandData, Reading, 7);
|
||||||
|
|
||||||
|
#ifndef PYCPARSE
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
struct GBARTC {
|
struct GBARTC {
|
||||||
int32_t bytesRemaining;
|
int32_t bytesRemaining;
|
||||||
|
@ -78,6 +79,9 @@ struct GBARTC {
|
||||||
uint8_t time[7];
|
uint8_t time[7];
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
#else
|
||||||
|
struct GBATRC;
|
||||||
|
#endif
|
||||||
|
|
||||||
struct GBAGBPKeyCallback {
|
struct GBAGBPKeyCallback {
|
||||||
struct mKeyCallback d;
|
struct mKeyCallback d;
|
||||||
|
|
|
@ -65,6 +65,18 @@ for line in preprocessed.splitlines():
|
||||||
lines.append(line)
|
lines.append(line)
|
||||||
ffi.cdef('\n'.join(lines))
|
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)
|
preprocessed = subprocess.check_output(cpp + ["-fno-inline", "-P"] + cppflags + [os.path.join(pydir, "lib.h")], universal_newlines=True)
|
||||||
|
|
||||||
lines = []
|
lines = []
|
||||||
|
|
|
@ -21,8 +21,8 @@ setup(
|
||||||
author_email="jeffrey@endrift.com",
|
author_email="jeffrey@endrift.com",
|
||||||
url="http://github.com/mgba-emu/mgba/",
|
url="http://github.com/mgba-emu/mgba/",
|
||||||
packages=["mgba"],
|
packages=["mgba"],
|
||||||
setup_requires=['cffi>=1.6,!=1.12.3', 'pytest-runner'],
|
setup_requires=['cffi>=1.6', 'pytest-runner'],
|
||||||
install_requires=['cffi>=1.6,!=1.12.3', 'cached-property'],
|
install_requires=['cffi>=1.6', 'cached-property'],
|
||||||
extras_require={'pil': ['Pillow>=2.3'], 'cinema': ['pyyaml', 'pytest']},
|
extras_require={'pil': ['Pillow>=2.3'], 'cinema': ['pyyaml', 'pytest']},
|
||||||
tests_require=['pytest'],
|
tests_require=['pytest'],
|
||||||
cffi_modules=["_builder.py:ffi"],
|
cffi_modules=["_builder.py:ffi"],
|
||||||
|
|
Loading…
Reference in New Issue