File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -208,6 +208,19 @@ fn main_0() -> i32 {
208208 ( ( sizes. as_pointer ( ) as Ptr < usize > ) . to_end ( ) ) . reinterpret_cast :: < usize > ( ) ;
209209 assert ! ( ( ( ( sizes_end) . clone( ) - ( sizes. as_pointer( ) as Ptr :: <usize >) ) as i64 == 4_i64 ) ) ;
210210 assert ! ( ( ( ( sizes_end. offset( -( ( 1 ) as isize ) ) ) . read( ) ) == 4_usize ) ) ;
211+ let set: Value < CFdSet > = Rc :: new ( RefCell :: new ( Default :: default ( ) ) ) ;
212+ ( set. as_pointer ( ) ) . with_mut ( |__s| __s. zero ( ) ) ;
213+ ( set. as_pointer ( ) ) . with_mut ( |__s| __s. set ( 3 ) ) ;
214+ assert ! (
215+ ( if ( set. as_pointer( ) ) . with( |__s| __s. isset( 3 ) ) {
216+ 1
217+ } else {
218+ 0
219+ } != 0 )
220+ ) ;
221+ libcc2rs:: cpp2rust_errno ( ) . write ( 42 ) ;
222+ assert ! ( ( ( libcc2rs:: cpp2rust_errno( ) . read( ) ) == 42 ) ) ;
223+ assert ! ( ( u32 :: from_be( u32 :: to_be( 7_u32 ) ) == 7_u32 ) ) ;
211224 return 0 ;
212225}
213226pub fn __cpp2rust_init_globals ( ) { }
Original file line number Diff line number Diff line change @@ -197,6 +197,13 @@ unsafe fn main_0() -> i32 {
197197 == ( 4_i64 ) )
198198 ) ;
199199 assert ! ( ( ( * ( sizes_end. offset( -( ( 1 ) as isize ) ) ) ) == ( 4_usize ) ) ) ;
200+ let mut set: :: libc:: fd_set = std:: mem:: zeroed :: < :: libc:: fd_set > ( ) ;
201+ libc:: FD_ZERO ( ( & mut set as * mut :: libc:: fd_set ) ) ;
202+ libc:: FD_SET ( 3 , ( & mut set as * mut :: libc:: fd_set ) ) ;
203+ assert ! ( ( libc:: FD_ISSET ( 3 , ( & mut set as * mut :: libc:: fd_set) . cast_const( ) ) as i32 != 0 ) ) ;
204+ ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) = 42 ;
205+ assert ! ( ( ( * libcc2rs:: cpp2rust_errno_unsafe( ) ) == ( 42 ) ) ) ;
206+ assert ! ( ( ( u32 :: from_be( u32 :: to_be( 7_u32 ) ) ) == ( 7_u32 ) ) ) ;
200207 return 0 ;
201208}
202209pub unsafe fn __cpp2rust_init_globals ( ) { }
Original file line number Diff line number Diff line change 1- #include < sys/select.h>
2-
3- #include < arpa/inet.h>
41#include < algorithm>
2+ #include < arpa/inet.h>
53#include < cassert>
64#include < cstddef>
75#include < cstdint>
86#include < errno.h>
97#include < iterator>
8+ #include < sys/select.h>
109#include < sys/types.h>
1110#include < utility>
1211
You can’t perform that action at this time.
0 commit comments