about summary refs log tree commit diff
path: root/src/liblibc
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-08-11 17:12:01 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-08-17 01:39:10 -0700
commit086a5ca7d25307325912cab2a67384867daa04c5 (patch)
tree758037316d3dfcc83fe79017e777dbef44c02072 /src/liblibc
parentcb9c1e0e702f4a1a5dfc909b15b74e8556013c06 (diff)
librustc: Allow trait bounds on structures and enumerations, and check
them during kind checking.

This implements RFC #11.

Closes #15759.
Diffstat (limited to 'src/liblibc')
-rw-r--r--src/liblibc/lib.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs
index bf0a9f06df8..0051d9a89c2 100644
--- a/src/liblibc/lib.rs
+++ b/src/liblibc/lib.rs
@@ -1456,13 +1456,24 @@ pub mod types {
                     pub Data4: [BYTE, ..8],
                 }
 
+                // NOTE(pcwalton, stage0): Remove after snapshot (typeck bug
+                // workaround).
+                #[cfg(stage0)]
                 pub struct WSAPROTOCOLCHAIN {
                     pub ChainLen: c_int,
                     pub ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN],
                 }
+                #[cfg(not(stage0))]
+                pub struct WSAPROTOCOLCHAIN {
+                    pub ChainLen: c_int,
+                    pub ChainEntries: [DWORD, ..MAX_PROTOCOL_CHAIN as uint],
+                }
 
                 pub type LPWSAPROTOCOLCHAIN = *mut WSAPROTOCOLCHAIN;
 
+                // NOTE(pcwalton, stage0): Remove after snapshot (typeck bug
+                // workaround).
+                #[cfg(stage0)]
                 pub struct WSAPROTOCOL_INFO {
                     pub dwServiceFlags1: DWORD,
                     pub dwServiceFlags2: DWORD,
@@ -1485,6 +1496,29 @@ pub mod types {
                     pub dwProviderReserved: DWORD,
                     pub szProtocol: [u8, ..WSAPROTOCOL_LEN+1],
                 }
+                #[cfg(not(stage0))]
+                pub struct WSAPROTOCOL_INFO {
+                    pub dwServiceFlags1: DWORD,
+                    pub dwServiceFlags2: DWORD,
+                    pub dwServiceFlags3: DWORD,
+                    pub dwServiceFlags4: DWORD,
+                    pub dwProviderFlags: DWORD,
+                    pub ProviderId: GUID,
+                    pub dwCatalogEntryId: DWORD,
+                    pub ProtocolChain: WSAPROTOCOLCHAIN,
+                    pub iVersion: c_int,
+                    pub iAddressFamily: c_int,
+                    pub iMaxSockAddr: c_int,
+                    pub iMinSockAddr: c_int,
+                    pub iSocketType: c_int,
+                    pub iProtocol: c_int,
+                    pub iProtocolMaxOffset: c_int,
+                    pub iNetworkByteOrder: c_int,
+                    pub iSecurityScheme: c_int,
+                    pub dwMessageSize: DWORD,
+                    pub dwProviderReserved: DWORD,
+                    pub szProtocol: [u8, ..(WSAPROTOCOL_LEN as uint) + 1u],
+                }
 
                 pub type LPWSAPROTOCOL_INFO = *mut WSAPROTOCOL_INFO;