@@ -16,28 +16,28 @@ use super::super::obj::objtype;
1616use super :: super :: pyobject:: { PyContext , PyFuncArgs , PyObjectRef , PyResult , TypeProtocol } ;
1717use super :: super :: vm:: VirtualMachine ;
1818
19- #[ cfg( target_family = " unix" ) ]
19+ #[ cfg( unix) ]
2020pub fn raw_file_number ( handle : File ) -> i64 {
2121 use std:: os:: unix:: io:: IntoRawFd ;
2222
2323 i64:: from ( handle. into_raw_fd ( ) )
2424}
2525
26- #[ cfg( target_family = " unix" ) ]
26+ #[ cfg( unix) ]
2727pub fn rust_file ( raw_fileno : i64 ) -> File {
2828 use std:: os:: unix:: io:: FromRawFd ;
2929
3030 unsafe { File :: from_raw_fd ( raw_fileno as i32 ) }
3131}
3232
33- #[ cfg( target_family = " windows" ) ]
33+ #[ cfg( windows) ]
3434pub fn raw_file_number ( handle : File ) -> i64 {
3535 use std:: os:: windows:: io:: IntoRawHandle ;
3636
3737 handle. into_raw_handle ( ) as i64
3838}
3939
40- #[ cfg( target_family = " windows" ) ]
40+ #[ cfg( windows) ]
4141pub fn rust_file ( raw_fileno : i64 ) -> File {
4242 use std:: ffi:: c_void;
4343 use std:: os:: windows:: io:: FromRawHandle ;
@@ -46,6 +46,16 @@ pub fn rust_file(raw_fileno: i64) -> File {
4646 unsafe { File :: from_raw_handle ( raw_fileno as * mut c_void ) }
4747}
4848
49+ #[ cfg( all( not( unix) , not( windows) ) ) ]
50+ pub fn rust_file ( raw_fileno : i64 ) -> File {
51+ unimplemented ! ( ) ;
52+ }
53+
54+ #[ cfg( all( not( unix) , not( windows) ) ) ]
55+ pub fn raw_file_number ( handle : File ) -> i64 {
56+ unimplemented ! ( ) ;
57+ }
58+
4959pub fn os_close ( vm : & mut VirtualMachine , args : PyFuncArgs ) -> PyResult {
5060 arg_check ! ( vm, args, required = [ ( fileno, Some ( vm. ctx. int_type( ) ) ) ] ) ;
5161
0 commit comments