11// Take a look at the license at the top of the repository in the LICENSE file.
22
3- #[ cfg( any ( windows, docsrs ) ) ]
3+ #[ cfg( windows) ]
44use std:: os:: windows:: io:: { AsRawHandle , FromRawHandle , IntoRawHandle , RawHandle } ;
55
66use glib:: { prelude:: * , translate:: * } ;
@@ -16,6 +16,8 @@ impl OutputStream {
1616 /// with `true` on this stream. At which point you may only do so when all references to this
1717 /// stream have been dropped.
1818 #[ doc( alias = "g_win32_output_stream_new" ) ]
19+ #[ cfg( windows) ]
20+ #[ cfg_attr( docsrs, doc( cfg( windows) ) ) ]
1921 pub unsafe fn take_handle ( handle : impl IntoRawHandle ) -> OutputStream {
2022 let handle = handle. into_raw_handle ( ) ;
2123 let close_handle = true . into_glib ( ) ;
@@ -29,6 +31,8 @@ impl OutputStream {
2931 /// # Safety
3032 /// You may only close the handle if all references to this stream have been dropped.
3133 #[ doc( alias = "g_win32_output_stream_new" ) ]
34+ #[ cfg( windows) ]
35+ #[ cfg_attr( docsrs, doc( cfg( windows) ) ) ]
3236 pub unsafe fn with_handle < T : AsRawHandle > ( handle : T ) -> OutputStream {
3337 let handle = handle. as_raw_handle ( ) ;
3438 let close_handle = false . into_glib ( ) ;
@@ -37,6 +41,8 @@ impl OutputStream {
3741 }
3842}
3943
44+ #[ cfg( windows) ]
45+ #[ cfg_attr( docsrs, doc( cfg( windows) ) ) ]
4046impl AsRawHandle for OutputStream {
4147 fn as_raw_handle ( & self ) -> RawHandle {
4248 unsafe { ffi:: g_win32_output_stream_get_handle ( self . to_glib_none ( ) . 0 ) as _ }
@@ -46,6 +52,8 @@ impl AsRawHandle for OutputStream {
4652pub trait OutputStreamExtManual : IsA < OutputStream > + Sized {
4753 #[ doc( alias = "g_win32_output_stream_get_handle" ) ]
4854 #[ doc( alias = "get_handle" ) ]
55+ #[ cfg( windows) ]
56+ #[ cfg_attr( docsrs, doc( cfg( windows) ) ) ]
4957 fn handle < T : FromRawHandle > ( & self ) -> T {
5058 unsafe {
5159 T :: from_raw_handle ( ffi:: g_win32_output_stream_get_handle (
0 commit comments