Skip to content

Commit 69e5eef

Browse files
committed
another attempt at ptp_clock_caps
1 parent 20ecfc3 commit 69e5eef

File tree

1 file changed

+47
-17
lines changed
  • src/unix/linux_like/linux

1 file changed

+47
-17
lines changed

src/unix/linux_like/linux/mod.rs

+47-17
Original file line numberDiff line numberDiff line change
@@ -811,23 +811,7 @@ s! {
811811
pub reserved: ::__u32,
812812
}
813813

814-
pub struct ptp_clock_caps {
815-
pub max_adj: ::c_int,
816-
pub n_alarm: ::c_int,
817-
pub n_ext_ts: ::c_int,
818-
pub n_per_out: ::c_int,
819-
pub pps: ::c_int,
820-
pub n_pins: ::c_int,
821-
pub cross_timestamping: ::c_int,
822-
#[cfg(not(any(target_env = "musl", target_env = "ohos")))]
823-
pub adjust_phase: ::c_int,
824-
#[cfg(not(any(target_env = "musl", target_env = "ohos")))]
825-
pub max_phase_adj: ::c_int,
826-
#[cfg(not(any(target_env = "musl", target_env = "ohos")))]
827-
pub rsv: [::c_int; 11],
828-
#[cfg(any(target_env = "musl", target_env = "ohos"))]
829-
pub rsv: [::c_int; 13],
830-
}
814+
831815

832816
pub struct ptp_extts_request {
833817
pub index: ::c_uint,
@@ -1087,6 +1071,52 @@ s! {
10871071
}
10881072
}
10891073

1074+
cfg_if! {
1075+
if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] {
1076+
s!{
1077+
pub struct ptp_clock_caps {
1078+
pub max_adj: ::c_int,
1079+
pub n_alarm: ::c_int,
1080+
pub n_ext_ts: ::c_int,
1081+
pub n_per_out: ::c_int,
1082+
pub pps: ::c_int,
1083+
pub n_pins: ::c_int,
1084+
pub cross_timestamping: ::c_int,
1085+
pub adjust_phase: ::c_int,
1086+
pub rsv: [::c_int; 12],
1087+
}
1088+
}
1089+
} else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
1090+
s!{
1091+
pub struct ptp_clock_caps {
1092+
pub max_adj: ::c_int,
1093+
pub n_alarm: ::c_int,
1094+
pub n_ext_ts: ::c_int,
1095+
pub n_per_out: ::c_int,
1096+
pub pps: ::c_int,
1097+
pub n_pins: ::c_int,
1098+
pub cross_timestamping: ::c_int,
1099+
pub rsv: [::c_int; 13],
1100+
}
1101+
}
1102+
} else {
1103+
s! {
1104+
pub struct ptp_clock_caps {
1105+
pub max_adj: ::c_int,
1106+
pub n_alarm: ::c_int,
1107+
pub n_ext_ts: ::c_int,
1108+
pub n_per_out: ::c_int,
1109+
pub pps: ::c_int,
1110+
pub n_pins: ::c_int,
1111+
pub cross_timestamping: ::c_int,
1112+
pub adjust_phase: ::c_int,
1113+
pub max_phase_adj: ::c_int,
1114+
pub rsv: [::c_int; 11],
1115+
}
1116+
}
1117+
}
1118+
}
1119+
10901120
cfg_if! {
10911121
if #[cfg(not(target_arch = "sparc64"))] {
10921122
s!{

0 commit comments

Comments
 (0)