Skip to content

Commit 734cd57

Browse files
G1gg1L3sshadinua
andauthored
RustThemis: remove deprecated bindgen flags (#1001)
* RustThemis: remove deprecated bindgen flags They were removed in the 0.65.0 [1]. [1]: rust-lang/rust-bindgen#2408 * Use simpler construction for checking the flag Co-authored-by: Dmytro Shapovalov <[email protected]> --------- Co-authored-by: Dmytro Shapovalov <[email protected]>
1 parent be54e99 commit 734cd57

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/wrappers/themis/rust/libthemis-sys/bindgen.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ set -e -o pipefail
2424
# Bindgen sees Soter as well as some system libraries, we don't need that.
2525
WHITELIST="(THEMIS|themis|secure_(comparator|session)|STATE)_.*"
2626

27+
EXTRA_FLAGS=
28+
29+
# This flag was deprecated and removed in 0.65.0 [1].
30+
# However, older bindgen versions still require it.
31+
#
32+
# [1]: https://github.com/rust-lang/rust-bindgen/pull/2408
33+
if bindgen | grep -q -- '--size_t-is-usize'; then
34+
EXTRA_FLAGS="--size_t-is-usize $EXTRA_FLAGS"
35+
fi
36+
2737
# Currently, we don't pass --target since none of the symbols we're linking
2838
# against are architecture-specific. If this ever becomes a problem, then the
2939
# thing to do is to split the generated code into different files for different
@@ -37,11 +47,11 @@ bindgen bindgen.h \
3747
--no-layout-tests \
3848
--disable-header-comment \
3949
--rustified-enum "themis_key_kind" \
40-
--size_t-is-usize \
4150
--allowlist-function "$WHITELIST" \
4251
--allowlist-type "$WHITELIST" \
4352
--allowlist-var "$WHITELIST" \
4453
--output src/lib.rs \
54+
$EXTRA_FLAGS \
4555
-- \
4656
-I ../../../../../include \
4757
-I ../../../../../src

0 commit comments

Comments
 (0)