diff options
author | Damian Jarek <damian.jarek93@gmail.com> | 2020-12-22 23:57:47 +0100 |
---|---|---|
committer | Yuki Okushi <huyuumi.dev@gmail.com> | 2021-01-07 09:22:43 +0900 |
commit | 1581af030450d160b24bf7a89d06a89fd97812c1 (patch) | |
tree | feb83859d8399df92dde013302e4af4f1030cf28 /libc-test/build.rs | |
parent | 6deb8a935a2b82a81852ff5ff4a08fc20a2d168a (diff) | |
download | rust-libc-1581af030450d160b24bf7a89d06a89fd97812c1.tar.gz |
Define basic Linux SocketCAN constants and types
Add definitions from `linux/can.h`, which is a "base" header for remainder
of SocketCAN functionality.
Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
Diffstat (limited to 'libc-test/build.rs')
-rwxr-xr-x | libc-test/build.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs index b84168f6d2..733b1a99a4 100755 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2442,6 +2442,7 @@ fn test_linux(target: &str) { headers! { cfg: "asm/mman.h", + "linux/can.h", "linux/dccp.h", "linux/errqueue.h", "linux/falloc.h", @@ -2556,6 +2557,9 @@ fn test_linux(target: &str) { }); cfg.skip_struct(move |ty| { + if ty.starts_with("__c_anonymous_") { + return true; + } match ty { // These cannot be tested when "resolv.h" is included and are tested // in the `linux_elf.rs` file. @@ -2697,6 +2701,10 @@ fn test_linux(target: &str) { | "IFLA_PERM_ADDRESS" | "IFLA_PROTO_DOWN_REASON" => true, + // FIXME: J1939 requires kernel header version 5.4 or higher, + // the MIPS CI target has a lower version + "CAN_J1939" => true, + _ => false, } }); @@ -2757,7 +2765,9 @@ fn test_linux(target: &str) { // this one is an anonymous union (struct_ == "ff_effect" && field == "u") || // `__exit_status` type is a patch which is absent in musl - (struct_ == "utmpx" && field == "ut_exit" && musl) + (struct_ == "utmpx" && field == "ut_exit" && musl) || + // `can_addr` is an anonymous union + (struct_ == "sockaddr_can" && field == "can_addr") }); cfg.volatile_item(|i| { |