Skip to content

Commit 21ee99a

Browse files
committed
dss_build.py: temp fixes -- update the actual header files
1 parent 09c4652 commit 21ee99a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

dss_build.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,22 @@ def process_header(src, extern_py=False, implement_py=False, prefix=''):
7979
ffi_builder_dss = FFI()
8080
debug = 'd' if version.endswith('d') else ''
8181

82-
with open(os.path.join(DSS_CAPI_PATH, 'include', 'dss_capi.h'), 'r') as f:
82+
main_header_fn = os.path.join(DSS_CAPI_PATH, 'include', 'dss_capi.h')
83+
dss_capi_ctx_path = os.path.join(DSS_CAPI_PATH, 'include', 'dss_capi_ctx.h')
84+
headers = [main_header_fn, dss_capi_ctx_path]
85+
# Temporary fixes for DSS C-API headers
86+
for fn in headers:
87+
with open(fn, 'r') as f:
88+
patched = (f.read().
89+
replace(' ctx_Fuses_Reset(void* ctx, int32_t Value)', ' ctx_Fuses_Reset(void* ctx)').
90+
replace(' Fuses_Reset(int32_t Value)', ' Fuses_Reset(void)')
91+
)
92+
with open(fn, 'w') as f:
93+
f.write(patched)
94+
95+
with open(main_header_fn, 'r') as f:
8396
cffi_header_dss = process_header(f.read())
8497

85-
dss_capi_ctx_path = os.path.join(DSS_CAPI_PATH, 'include', 'dss_capi_ctx.h')
8698
if os.path.exists(dss_capi_ctx_path):
8799
with open(dss_capi_ctx_path, 'r') as f:
88100
cffi_header_dss += process_header(f.read())

0 commit comments

Comments
 (0)