@@ -51,10 +51,8 @@ impl ClockId {
51
51
#[ cfg( not( any(
52
52
target_os = "macos" ,
53
53
target_os = "ios" ,
54
- all(
55
- not( any( target_env = "uclibc" , target_env = "newlibc" ) ) ,
56
- any( target_os = "redox" , target_os = "hermit" , ) ,
57
- ) ,
54
+ target_os = "redox" ,
55
+ target_os = "hermit" ,
58
56
) ) ) ]
59
57
pub fn set_time ( self , timespec : TimeSpec ) -> Result < ( ) > {
60
58
clock_settime ( self , timespec)
@@ -66,72 +64,65 @@ impl ClockId {
66
64
}
67
65
68
66
#[ cfg( any(
67
+ target_os = "android" ,
68
+ target_os = "emscripten" ,
69
69
target_os = "fuchsia" ,
70
- all(
71
- not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
72
- any( target_os = "linux" , target_os = "android" , target_os = "emscripten" ) ,
73
- )
70
+ target_os = "linux"
74
71
) ) ]
75
72
pub const CLOCK_BOOTTIME : ClockId = ClockId ( libc:: CLOCK_BOOTTIME ) ;
76
73
#[ cfg( any(
74
+ target_os = "android" ,
75
+ target_os = "emscripten" ,
77
76
target_os = "fuchsia" ,
78
- all(
79
- not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
80
- any( target_os = "linux" , target_os = "android" , target_os = "emscripten" )
81
- )
77
+ target_os = "linux"
82
78
) ) ]
83
79
pub const CLOCK_BOOTTIME_ALARM : ClockId = ClockId ( libc:: CLOCK_BOOTTIME_ALARM ) ;
84
80
pub const CLOCK_MONOTONIC : ClockId = ClockId ( libc:: CLOCK_MONOTONIC ) ;
85
81
#[ cfg( any(
82
+ target_os = "android" ,
83
+ target_os = "emscripten" ,
86
84
target_os = "fuchsia" ,
87
- all(
88
- not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
89
- any( target_os = "linux" , target_os = "android" , target_os = "emscripten" )
90
- )
85
+ target_os = "linux"
91
86
) ) ]
92
87
pub const CLOCK_MONOTONIC_COARSE : ClockId = ClockId ( libc:: CLOCK_MONOTONIC_COARSE ) ;
93
88
#[ cfg( any( target_os = "freebsd" , target_os = "dragonfly" ) ) ]
94
89
pub const CLOCK_MONOTONIC_FAST : ClockId = ClockId ( libc:: CLOCK_MONOTONIC_FAST ) ;
95
90
#[ cfg( any( target_os = "freebsd" , target_os = "dragonfly" ) ) ]
96
91
pub const CLOCK_MONOTONIC_PRECISE : ClockId = ClockId ( libc:: CLOCK_MONOTONIC_PRECISE ) ;
97
92
#[ cfg( any(
93
+ target_os = "android" ,
94
+ target_os = "emscripten" ,
98
95
target_os = "fuchsia" ,
99
- all(
100
- not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
101
- any( target_os = "linux" , target_os = "android" , target_os = "emscripten" )
102
- )
96
+ target_os = "linux"
103
97
) ) ]
104
98
pub const CLOCK_MONOTONIC_RAW : ClockId = ClockId ( libc:: CLOCK_MONOTONIC_RAW ) ;
105
99
#[ cfg( any(
100
+ target_os = "android" ,
101
+ target_os = "emscripten" ,
106
102
target_os = "fuchsia" ,
107
- target_env = "uclibc" ,
108
103
target_os = "macos" ,
109
104
target_os = "ios" ,
110
105
target_os = "freebsd" ,
111
106
target_os = "dragonfly" ,
112
- all(
113
- not( target_env = "newlib" ) ,
114
- any( target_os = "linux" , target_os = "android" , target_os = "emscripten" )
115
- )
107
+ target_os = "redox" ,
108
+ target_os = "linux"
116
109
) ) ]
117
110
pub const CLOCK_PROCESS_CPUTIME_ID : ClockId = ClockId ( libc:: CLOCK_PROCESS_CPUTIME_ID ) ;
118
111
#[ cfg( any( target_os = "freebsd" , target_os = "dragonfly" ) ) ]
119
112
pub const CLOCK_PROF : ClockId = ClockId ( libc:: CLOCK_PROF ) ;
120
113
pub const CLOCK_REALTIME : ClockId = ClockId ( libc:: CLOCK_REALTIME ) ;
121
114
#[ cfg( any(
115
+ target_os = "android" ,
116
+ target_os = "emscripten" ,
122
117
target_os = "fuchsia" ,
123
- all(
124
- not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
125
- any( target_os = "linux" , target_os = "android" , target_os = "emscripten" )
126
- )
118
+ target_os = "linux"
127
119
) ) ]
128
120
pub const CLOCK_REALTIME_ALARM : ClockId = ClockId ( libc:: CLOCK_REALTIME_ALARM ) ;
129
121
#[ cfg( any(
122
+ target_os = "android" ,
123
+ target_os = "emscripten" ,
130
124
target_os = "fuchsia" ,
131
- all(
132
- not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
133
- any( target_os = "linux" , target_os = "android" , target_os = "emscripten" )
134
- )
125
+ target_os = "linux"
135
126
) ) ]
136
127
pub const CLOCK_REALTIME_COARSE : ClockId = ClockId ( libc:: CLOCK_REALTIME_COARSE ) ;
137
128
#[ cfg( any( target_os = "freebsd" , target_os = "dragonfly" ) ) ]
@@ -141,38 +132,27 @@ impl ClockId {
141
132
#[ cfg( any( target_os = "freebsd" , target_os = "dragonfly" ) ) ]
142
133
pub const CLOCK_SECOND : ClockId = ClockId ( libc:: CLOCK_SECOND ) ;
143
134
#[ cfg( any(
135
+ target_os = "emscripten" ,
144
136
target_os = "fuchsia" ,
145
- all(
146
- not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
147
- any(
148
- target_os = "emscripten" ,
149
- all( target_os = "linux" , target_env = "musl" )
150
- )
151
- )
137
+ all( target_os = "linux" , target_env = "musl" )
152
138
) ) ]
153
139
pub const CLOCK_SGI_CYCLE : ClockId = ClockId ( libc:: CLOCK_SGI_CYCLE ) ;
154
140
#[ cfg( any(
141
+ target_os = "android" ,
142
+ target_os = "emscripten" ,
155
143
target_os = "fuchsia" ,
156
- all(
157
- not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
158
- any(
159
- target_os = "emscripten" ,
160
- all( target_os = "linux" , target_env = "musl" )
161
- )
162
- )
144
+ target_os = "linux"
163
145
) ) ]
164
146
pub const CLOCK_TAI : ClockId = ClockId ( libc:: CLOCK_TAI ) ;
165
147
#[ cfg( any(
166
- target_env = "uclibc" ,
148
+ target_os = "android" ,
149
+ target_os = "emscripten" ,
167
150
target_os = "fuchsia" ,
168
151
target_os = "ios" ,
169
152
target_os = "macos" ,
170
153
target_os = "freebsd" ,
171
154
target_os = "dragonfly" ,
172
- all(
173
- not( target_env = "newlib" ) ,
174
- any( target_os = "linux" , target_os = "android" , target_os = "emscripten" , ) ,
175
- ) ,
155
+ target_os = "linux"
176
156
) ) ]
177
157
pub const CLOCK_THREAD_CPUTIME_ID : ClockId = ClockId ( libc:: CLOCK_THREAD_CPUTIME_ID ) ;
178
158
#[ cfg( any( target_os = "freebsd" , target_os = "dragonfly" ) ) ]
@@ -229,10 +209,9 @@ pub fn clock_gettime(clock_id: ClockId) -> Result<TimeSpec> {
229
209
#[ cfg( not( any(
230
210
target_os = "macos" ,
231
211
target_os = "ios" ,
232
- all(
233
- not( any( target_env = "uclibc" , target_env = "newlibc" ) ) ,
234
- any( target_os = "redox" , target_os = "hermit" , ) ,
235
- ) ,
212
+ target_env = "uclibc" ,
213
+ target_os = "redox" ,
214
+ target_os = "hermit" ,
236
215
) ) ) ]
237
216
pub fn clock_settime ( clock_id : ClockId , timespec : TimeSpec ) -> Result < ( ) > {
238
217
let ret = unsafe { libc:: clock_settime ( clock_id. as_raw ( ) , timespec. as_ref ( ) ) } ;
0 commit comments