Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

Commit

Permalink
gio/sys: resolve winapi reference
Browse files Browse the repository at this point in the history
It was broken to build gio package on windows platform.

16 |         self::winapi::shared::ws2def::AF_UNSPEC;
   |               ^^^^^^ could not find `winapi` in `self`
  • Loading branch information
wonchulee committed Dec 7, 2020
1 parent 3ae272c commit 1a4e69e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions gio/sys/src/manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ pub type GSocketMsgFlags = libc::c_int;

#[cfg(target_family = "windows")]
mod windows_constants {
pub const G_SOCKET_FAMILY_INVALID: super::GSocketFamily =
self::winapi::shared::ws2def::AF_UNSPEC;
pub const G_SOCKET_FAMILY_UNIX: super::GSocketFamily = self::winapi::shared::ws2def::AF_UNIX;
pub const G_SOCKET_FAMILY_IPV4: super::GSocketFamily = self::winapi::shared::ws2def::AF_INET;
pub const G_SOCKET_FAMILY_IPV6: super::GSocketFamily = self::winapi::shared::ws2def::AF_INET6;
pub const G_SOCKET_FAMILY_INVALID: super::GSocketFamily = winapi::shared::ws2def::AF_UNSPEC;
pub const G_SOCKET_FAMILY_UNIX: super::GSocketFamily = winapi::shared::ws2def::AF_UNIX;
pub const G_SOCKET_FAMILY_IPV4: super::GSocketFamily = winapi::shared::ws2def::AF_INET;
pub const G_SOCKET_FAMILY_IPV6: super::GSocketFamily = winapi::shared::ws2def::AF_INET6;

pub const G_SOCKET_MSG_NONE: super::GSocketMsgFlags = 0;
pub const G_SOCKET_MSG_OOB: super::GSocketMsgFlags = self::winapi::um::winsock2::MSG_OOB;
pub const G_SOCKET_MSG_PEEK: super::GSocketMsgFlags = self::winapi::um::winsock2::MSG_PEEK;
pub const G_SOCKET_MSG_DONTROUTE: super::GSocketMsgFlags =
self::winapi::um::winsock2::MSG_DONTROUTE;
pub const G_SOCKET_MSG_OOB: super::GSocketMsgFlags = winapi::um::winsock2::MSG_OOB;
pub const G_SOCKET_MSG_PEEK: super::GSocketMsgFlags = winapi::um::winsock2::MSG_PEEK;
pub const G_SOCKET_MSG_DONTROUTE: super::GSocketMsgFlags = winapi::um::winsock2::MSG_DONTROUTE;
}

#[cfg(not(target_family = "windows"))]
Expand Down

0 comments on commit 1a4e69e

Please sign in to comment.