generate better headers
This commit is contained in:
parent
45dec7fb56
commit
1735458d20
@ -134,9 +134,10 @@ ${BUILD_DIR}/bindgen.i : bindgen.h
|
||||
|
||||
|
||||
${BUILD_DIR}/bindgen.rs : ${BUILD_DIR}/bindgen.i
|
||||
bindgen --allowlist-type "List_t|TaskHandle_t|TaskStatus_t|TCB_t" ${BUILD_DIR}/bindgen.i -o ${BUILD_DIR}/bindings.rs
|
||||
bindgen --no-layout-tests --allowlist-type "List_t|TaskHandle_t|TaskStatus_t|TCB_t" ${BUILD_DIR}/bindgen.i -o ${BUILD_DIR}/bindings.rs
|
||||
sh write_header.sh
|
||||
sed -i -f transform.sed build/bindings.rs
|
||||
cat typeheader.rs build/bindings.rs > build/bindings_2.rs
|
||||
cat build/header.rs build/bindings.rs > build/bindings_2.rs
|
||||
# --ctypes-prefix compat_types
|
||||
# bindgen --new-type-alias void --default-alias-style new_type --allowlist-type "List_t|TaskHandle_t|TaskStatus_t|TCB_t" ${BUILD_DIR}/bindgen.i -o ${BUILD_DIR}/bindings.rs
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
s@::c_ulong@::c_uint@
|
||||
s@*mut ::std::os::raw::c_void@void_ptr@
|
||||
s@*const ::std::os::raw::c_char@char_ptr@
|
||||
s@*mut \([A-Z,_,a-z]*\),@\1_ptr,@
|
||||
s@*mut \([A-Z_a-z]*\)@\1_ptr@
|
||||
s@Debug, Copy, Clone@Debug, Copy, Clone, Default, Serialize, Deserialize@
|
3
FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/write_header.sh
Normal file
3
FreeRTOS/Demo/CORTEX_M3_MPS2_QEMU_GCC/write_header.sh
Normal file
@ -0,0 +1,3 @@
|
||||
while IFS= read -r line; do
|
||||
echo pub type $line = "::std::os::raw::c_uint;" | sed -f transform.sed
|
||||
done <<< "$(grep -oE "\*mut [A-Z:_a-z]*|\*const [A-Z:a-z_]*char" build/bindings.rs | sort | uniq)" > build/header.rs
|
Loading…
x
Reference in New Issue
Block a user