Skip to content

Commit fbc340c

Browse files
author
Жунёва Мария Михайловна
committed
Add structures for freebsd
1 parent 7d7151c commit fbc340c

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

.cirrus.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ task:
33
freebsd_instance:
44
image_family: freebsd-13-3
55
setup_script:
6-
- pkg install -y libnghttp2 curl
6+
- pkg install -y libnghttp2 curl evdev-proto
77
- curl https://sh.rustup.rs -sSf --output rustup.sh
88
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
99
- . $HOME/.cargo/env
@@ -17,7 +17,7 @@ task:
1717
freebsd_instance:
1818
image: freebsd-14-1-release-amd64-ufs
1919
setup_script:
20-
- pkg install -y libnghttp2 curl
20+
- pkg install -y libnghttp2 curl evdev-proto
2121
- curl https://sh.rustup.rs -sSf --output rustup.sh
2222
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
2323
- . $HOME/.cargo/env
@@ -31,7 +31,7 @@ task:
3131
freebsd_instance:
3232
image_family: freebsd-15-0-snap
3333
setup_script:
34-
- pkg install -y libnghttp2 curl
34+
- pkg install -y libnghttp2 curl evdev-proto
3535
- curl https://sh.rustup.rs -sSf --output rustup.sh
3636
- sh rustup.sh -y --default-toolchain nightly --profile=minimal
3737
- . $HOME/.cargo/env

libc-test/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,6 +1990,9 @@ fn test_freebsd(target: &str) {
19901990
cfg.define("_WITH_GETLINE", None);
19911991
// Required for making freebsd11_stat available in the headers
19921992
cfg.define("_WANT_FREEBSD11_STAT", None);
1993+
cfg.define("LIBICONV_PLUG", None);
1994+
1995+
cfg.flag("-I/usr/local/include");
19931996

19941997
let freebsd13 = match freebsd_ver {
19951998
Some(n) if n >= 13 => true,
@@ -2091,6 +2094,7 @@ fn test_freebsd(target: &str) {
20912094
"sys/thr.h",
20922095
"sys/time.h",
20932096
[freebsd14 || freebsd15]:"sys/timerfd.h",
2097+
[freebsd13 || freebsd14 || freebsd15]:"linux/input.h",
20942098
"sys/times.h",
20952099
"sys/timex.h",
20962100
"sys/types.h",
@@ -2164,6 +2168,7 @@ fn test_freebsd(target: &str) {
21642168
"type_" if struct_ == "rtprio" => "type".to_string(),
21652169
"type_" if struct_ == "sockstat" => "type".to_string(),
21662170
"type_" if struct_ == "devstat_match_table" => "type".to_string(),
2171+
"type_" if struct_ == "input_event" => "type".to_string(),
21672172
s => s.to_string(),
21682173
}
21692174
});

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,22 @@ s! {
288288
pub sem_flg: ::c_short,
289289
}
290290

291+
pub struct input_event {
292+
pub time: ::timeval,
293+
pub type_: ::u_short,
294+
pub code: ::u_short,
295+
pub value: ::c_int,
296+
}
297+
298+
pub struct input_absinfo {
299+
pub value: ::c_int,
300+
pub minimum: ::c_int,
301+
pub maximum: ::c_int,
302+
pub fuzz: ::c_int,
303+
pub flat: ::c_int,
304+
pub resolution: ::c_int,
305+
}
306+
291307
pub struct msqid_ds {
292308
pub msg_perm: ::ipc_perm,
293309
__unused1: *mut ::c_void,

0 commit comments

Comments
 (0)