Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure bridging header function prototypes are valid
Compiling my swift project I am seeing: ``` Generated/mycrateFFI.h:75:45: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] ``` for the `ffi_mycrate_uniffi_contract_version` and `uniffi_mycrate_checksum_func_myfun` declarations. This is because they take no arguments which is emitted as `()`, for C `(void)` is required, C++ is happy with either. Add a specific case to `swift::arg_list_ffi_decl` to handle this. The resulting diff is: ``` --- mycrateFFI.h 2023-04-06 10:38:25.645130502 +0100 +++ mycrateFFI.h 2023-04-06 11:01:12.415958817 +0100 @@ -73,9 +73,11 @@ RustBuffer ffi_mycrate_rustbuffer_reserv ); uint32_t ffi_mycrate_uniffi_contract_version( + void ); uint16_t uniffi_mycrate_checksum_func_myfun( + void ); ```
- Loading branch information