@@ -15,7 +15,7 @@ fn test_clocks() {
1515 assert_eq ! ( is_error, 0 ) ;
1616 let is_error = unsafe { libc:: clock_gettime ( libc:: CLOCK_MONOTONIC , tp. as_mut_ptr ( ) ) } ;
1717 assert_eq ! ( is_error, 0 ) ;
18- #[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
18+ #[ cfg( any( target_os = "linux" , target_os = "freebsd" , target_os = "android" ) ) ]
1919 {
2020 let is_error = unsafe { libc:: clock_gettime ( libc:: CLOCK_REALTIME_COARSE , tp. as_mut_ptr ( ) ) } ;
2121 assert_eq ! ( is_error, 0 ) ;
@@ -63,9 +63,19 @@ fn test_localtime_r() {
6363 tm_wday : 0 ,
6464 tm_yday : 0 ,
6565 tm_isdst : 0 ,
66- #[ cfg( any( target_os = "linux" , target_os = "macos" , target_os = "freebsd" ) ) ]
66+ #[ cfg( any(
67+ target_os = "linux" ,
68+ target_os = "macos" ,
69+ target_os = "freebsd" ,
70+ target_os = "android"
71+ ) ) ]
6772 tm_gmtoff : 0 ,
68- #[ cfg( any( target_os = "linux" , target_os = "macos" , target_os = "freebsd" ) ) ]
73+ #[ cfg( any(
74+ target_os = "linux" ,
75+ target_os = "macos" ,
76+ target_os = "freebsd" ,
77+ target_os = "android"
78+ ) ) ]
6979 tm_zone : std:: ptr:: null_mut :: < libc:: c_char > ( ) ,
7080 } ;
7181 let res = unsafe { libc:: localtime_r ( custom_time_ptr, & mut tm) } ;
@@ -79,9 +89,19 @@ fn test_localtime_r() {
7989 assert_eq ! ( tm. tm_wday, 0 ) ;
8090 assert_eq ! ( tm. tm_yday, 97 ) ;
8191 assert_eq ! ( tm. tm_isdst, -1 ) ;
82- #[ cfg( any( target_os = "linux" , target_os = "macos" , target_os = "freebsd" ) ) ]
92+ #[ cfg( any(
93+ target_os = "linux" ,
94+ target_os = "macos" ,
95+ target_os = "freebsd" ,
96+ target_os = "android"
97+ ) ) ]
8398 assert_eq ! ( tm. tm_gmtoff, 0 ) ;
84- #[ cfg( any( target_os = "linux" , target_os = "macos" , target_os = "freebsd" ) ) ]
99+ #[ cfg( any(
100+ target_os = "linux" ,
101+ target_os = "macos" ,
102+ target_os = "freebsd" ,
103+ target_os = "android"
104+ ) ) ]
85105 unsafe {
86106 assert_eq ! ( std:: ffi:: CStr :: from_ptr( tm. tm_zone) . to_str( ) . unwrap( ) , "+00" )
87107 } ;
0 commit comments