@@ -5,42 +5,51 @@ use libc;
5
5
6
6
libc_enum ! {
7
7
#[ cfg_attr( any(
8
+ target_env = "uclibc" ,
9
+ all( target_env = "newlib" , target_arch = "arm" ) ,
8
10
target_os = "fuchsia" ,
9
11
target_os = "redox" ,
10
- target_env = "uclibc" ,
11
12
target_os = "freebsd" ,
12
13
target_os = "netbsd" ,
13
14
target_os = "openbsd" ,
14
15
target_os = "haiku" ,
15
- target_os = "linux" ,
16
- target_os = "android " ,
17
- target_os = "emscripten " ,
18
- target_os = "solaris " ,
19
- target_os = "illumos " ,
20
- all ( target_env = "newlib" , target_arch = "arm" ) ,
16
+ all ( not ( target_env = "newlib" ) ,
17
+ any ( target_os = "linux " ,
18
+ target_os = "android " ,
19
+ target_os = "emscripten " ,
20
+ target_os = "solaris " ,
21
+ target_os = "illumos" ) ) ,
21
22
) , repr( i32 ) ) ]
22
23
#[ cfg_attr( any( target_os = "macos" , target_os = "ios" ) , repr( u32 ) ) ]
23
24
#[ cfg_attr( any(
24
- target_os = "hermit" ,
25
25
all( target_env = "newlib" , target_arch = "aarch64" ) ,
26
+ all( not( any( target_env = "newlib" , target_env = "uclibc" ) ) , target_os = "hermit" ) ,
26
27
target_os = "dragonfly" ,
27
28
) , repr( u64 ) ) ]
28
29
pub enum ClockId {
29
30
#[ cfg( any( target_os = "fuchsia" ,
30
- target_os = "linux" ,
31
- target_os = "android" ,
32
- target_os = "emscripten" ) ) ]
31
+ all( not( any( target_env = "uclibc" ,
32
+ target_env = "newlib" ) ) ,
33
+ any( target_os = "linux" ,
34
+ target_os = "android" ,
35
+ target_os = "emscripten" ) ,
36
+ )
37
+ ) ) ]
33
38
CLOCK_BOOTTIME ,
34
39
#[ cfg( any( target_os = "fuchsia" ,
35
- target_os = "linux" ,
36
- target_os = "android" ,
37
- target_os = "emscripten" ) ) ]
40
+ all( not( any( target_env = "uclibc" ,
41
+ target_env = "newlib" ) ) ,
42
+ any( target_os = "linux" ,
43
+ target_os = "android" ,
44
+ target_os = "emscripten" ) ) ) ) ]
38
45
CLOCK_BOOTTIME_ALARM ,
39
46
CLOCK_MONOTONIC ,
40
47
#[ cfg( any( target_os = "fuchsia" ,
41
- target_os = "linux" ,
42
- target_os = "android" ,
43
- target_os = "emscripten" ) ) ]
48
+ all( not( any( target_env = "uclibc" ,
49
+ target_env = "newlib" ) ) ,
50
+ any( target_os = "linux" ,
51
+ target_os = "android" ,
52
+ target_os = "emscripten" ) ) ) ) ]
44
53
CLOCK_MONOTONIC_COARSE ,
45
54
#[ cfg( any( target_os = "freebsd" ,
46
55
target_os = "dragonfly" ) ) ]
@@ -49,33 +58,40 @@ libc_enum! {
49
58
target_os = "dragonfly" ) ) ]
50
59
CLOCK_MONOTONIC_PRECISE ,
51
60
#[ cfg( any( target_os = "fuchsia" ,
52
- target_os = "linux" ,
53
- target_os = "android" ,
54
- target_os = "emscripten" ) ) ]
61
+ all( not( any( target_env = "uclibc" ,
62
+ target_env = "newlib" ) ) ,
63
+ any( target_os = "linux" ,
64
+ target_os = "android" ,
65
+ target_os = "emscripten" ) ) ) ) ]
55
66
CLOCK_MONOTONIC_RAW ,
56
67
#[ cfg( any( target_os = "fuchsia" ,
57
68
target_env = "uclibc" ,
58
69
target_os = "macos" ,
59
70
target_os = "ios" ,
60
71
target_os = "freebsd" ,
61
72
target_os = "dragonfly" ,
62
- target_os = "linux" ,
63
- target_os = "android" ,
64
- target_os = "emscripten" ) ) ]
73
+ all( not( target_env = "newlib" ) ,
74
+ any( target_os = "linux" ,
75
+ target_os = "android" ,
76
+ target_os = "emscripten" ) ) ) ) ]
65
77
CLOCK_PROCESS_CPUTIME_ID ,
66
78
#[ cfg( any( target_os = "freebsd" ,
67
79
target_os = "dragonfly" ) ) ]
68
80
CLOCK_PROF ,
69
81
CLOCK_REALTIME ,
70
82
#[ cfg( any( target_os = "fuchsia" ,
71
- target_os = "linux" ,
72
- target_os = "android" ,
73
- target_os = "emscripten" ) ) ]
83
+ all( not( any( target_env = "uclibc" ,
84
+ target_env = "newlib" ) ) ,
85
+ any( target_os = "linux" ,
86
+ target_os = "android" ,
87
+ target_os = "emscripten" ) ) ) ) ]
74
88
CLOCK_REALTIME_ALARM ,
75
89
#[ cfg( any( target_os = "fuchsia" ,
76
- target_os = "linux" ,
77
- target_os = "android" ,
78
- target_os = "emscripten" ) ) ]
90
+ all( not( any( target_env = "uclibc" ,
91
+ target_env = "newlib" ) ) ,
92
+ any( target_os = "linux" ,
93
+ target_os = "android" ,
94
+ target_os = "emscripten" ) ) ) ) ]
79
95
CLOCK_REALTIME_COARSE ,
80
96
#[ cfg( any( target_os = "freebsd" ,
81
97
target_os = "dragonfly" ) ) ]
@@ -87,22 +103,32 @@ libc_enum! {
87
103
target_os = "dragonfly" ) ) ]
88
104
CLOCK_SECOND ,
89
105
#[ cfg( any( target_os = "fuchsia" ,
90
- target_os = "emscripten" ,
91
- all( target_os = "linux" , target_env = "musl" ) ) ) ]
106
+ all( not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
107
+ any( target_os = "emscripten" ,
108
+ all( target_os = "linux" , target_env = "musl" ) ) ) ) ) ]
92
109
CLOCK_SGI_CYCLE ,
93
110
#[ cfg( any( target_os = "fuchsia" ,
94
- target_os = "emscripten" ,
95
- all( target_os = "linux" , target_env = "musl" ) ) ) ]
111
+ all( not( any( target_env = "uclibc" , target_env = "newlib" ) ) ,
112
+ any( target_os = "emscripten" ,
113
+ all( target_os = "linux" , target_env = "musl" ) ) ) ) ) ]
96
114
CLOCK_TAI ,
97
- #[ cfg( any( target_os = "fuchsia" ,
115
+ #[ cfg( any(
116
+ target_env = "uclibc" ,
117
+ target_os = "fuchsia" ,
98
118
target_os = "ios" ,
99
119
target_os = "macos" ,
100
120
target_os = "freebsd" ,
101
121
target_os = "dragonfly" ,
102
- target_os = "linux" ,
103
- target_os = "android" ,
104
- target_os = "emscripten" ,
105
- target_env = "uclibc" ) ) ]
122
+ all(
123
+ not( target_env = "newlib" ) ,
124
+ any(
125
+ target_os = "linux" ,
126
+ target_os = "android" ,
127
+ target_os = "emscripten" ,
128
+ ) ,
129
+ ) ,
130
+ )
131
+ ) ]
106
132
CLOCK_THREAD_CPUTIME_ID ,
107
133
#[ cfg( any( target_os = "freebsd" ,
108
134
target_os = "dragonfly" ) ) ]
@@ -139,8 +165,13 @@ pub fn clock_gettime(clk_id: ClockId) -> Result<TimeSpec> {
139
165
any(
140
166
target_os = "macos" ,
141
167
target_os = "ios" ,
142
- target_os = "redox" ,
143
- target_os = "hermit" ,
168
+ all(
169
+ not( any( target_env = "uclibc" , target_env = "newlibc" ) ) ,
170
+ any(
171
+ target_os = "redox" ,
172
+ target_os = "hermit" ,
173
+ ) ,
174
+ ) ,
144
175
)
145
176
)
146
177
) ]
0 commit comments