@@ -7,29 +7,29 @@ use std::io::{Read, Seek, Write};
77use std:: os:: fd:: { AsFd , FromRawFd , IntoRawFd } ;
88use std:: rc:: Rc ;
99pub unsafe fn test_errno_0 ( ) {
10- ( * libcc2rs:: cpp2rust_errno ( ) ) = 0 ;
11- assert ! ( ( ( ( ( * libcc2rs:: cpp2rust_errno ( ) ) == ( 0 ) ) as i32 ) != 0 ) ) ;
12- ( * libcc2rs:: cpp2rust_errno ( ) ) = 42 ;
13- assert ! ( ( ( ( ( * libcc2rs:: cpp2rust_errno ( ) ) == ( 42 ) ) as i32 ) != 0 ) ) ;
14- let mut saved: i32 = ( * libcc2rs:: cpp2rust_errno ( ) ) ;
10+ ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) = 0 ;
11+ assert ! ( ( ( ( ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) == ( 0 ) ) as i32 ) != 0 ) ) ;
12+ ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) = 42 ;
13+ assert ! ( ( ( ( ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) == ( 42 ) ) as i32 ) != 0 ) ) ;
14+ let mut saved: i32 = ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) ;
1515 assert ! ( ( ( ( ( saved) == ( 42 ) ) as i32 ) != 0 ) ) ;
16- ( * libcc2rs:: cpp2rust_errno ( ) ) = 0 ;
16+ ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) = 0 ;
1717}
1818pub unsafe fn test_errno_preserved_across_strdup_1 ( ) {
19- ( * libcc2rs:: cpp2rust_errno ( ) ) = 99 ;
19+ ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) = 99 ;
2020 let mut d: * mut libc:: c_char =
2121 libcc2rs:: strdup_unsafe ( ( c"hello" . as_ptr ( ) . cast_mut ( ) ) . cast_const ( ) ) ;
2222 assert ! ( ( ( ( !( ( d) . is_null( ) ) ) as i32 ) != 0 ) ) ;
23- assert ! ( ( ( ( ( * libcc2rs:: cpp2rust_errno ( ) ) == ( 99 ) ) as i32 ) != 0 ) ) ;
23+ assert ! ( ( ( ( ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) == ( 99 ) ) as i32 ) != 0 ) ) ;
2424 libcc2rs:: free_unsafe ( ( d as * mut libc:: c_char as * mut :: libc:: c_void ) ) ;
25- ( * libcc2rs:: cpp2rust_errno ( ) ) = 0 ;
25+ ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) = 0 ;
2626}
2727pub unsafe fn test_errno_from_fseek_2 ( ) {
28- ( * libcc2rs:: cpp2rust_errno ( ) ) = 0 ;
28+ ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) = 0 ;
2929 let mut r: i32 = libc:: fseek ( libcc2rs:: stdin_unsafe ( ) , 0_i64 as :: libc:: c_long , 0 ) ;
3030 assert ! ( ( ( ( ( r) == ( -1_i32 ) ) as i32 ) != 0 ) ) ;
31- assert ! ( ( ( ( ( * libcc2rs:: cpp2rust_errno ( ) ) == ( 29 ) ) as i32 ) != 0 ) ) ;
32- ( * libcc2rs:: cpp2rust_errno ( ) ) = 0 ;
31+ assert ! ( ( ( ( ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) == ( 29 ) ) as i32 ) != 0 ) ) ;
32+ ( * libcc2rs:: cpp2rust_errno_unsafe ( ) ) = 0 ;
3333}
3434pub fn main ( ) {
3535 unsafe {
0 commit comments