about summary refs log tree commit diff
path: root/src/libnative/io
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2014-05-27 18:37:49 -0700
committerCorey Richardson <corey@octayn.net>2014-08-20 21:02:23 -0400
commitbc19a776312eda23e8add1d9f6db4d9d7401d9cb (patch)
tree0c0b48ee6caf520010b9a81ae1cbe8ccb579301d /src/libnative/io
parent6e8ff999589a7b4c7f62f7128f3e028a7b3ea64f (diff)
downloadrust-bc19a776312eda23e8add1d9f6db4d9d7401d9cb.tar.gz
rust-bc19a776312eda23e8add1d9f6db4d9d7401d9cb.zip
Add #[repr(C)] to all the things!
Diffstat (limited to 'src/libnative/io')
-rw-r--r--src/libnative/io/c_unix.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libnative/io/c_unix.rs b/src/libnative/io/c_unix.rs
index af4d309dfe2..1f8584cbd09 100644
--- a/src/libnative/io/c_unix.rs
+++ b/src/libnative/io/c_unix.rs
@@ -91,6 +91,7 @@ extern {
 mod select {
     pub static FD_SETSIZE: uint = 1024;
 
+    #[repr(C)]
     pub struct fd_set {
         fds_bits: [i32, ..(FD_SETSIZE / 32)]
     }
@@ -109,6 +110,7 @@ mod select {
 
     pub static FD_SETSIZE: uint = 1024;
 
+    #[repr(C)]
     pub struct fd_set {
         // FIXME: shouldn't this be a c_ulong?
         fds_bits: [uint, ..(FD_SETSIZE / uint::BITS)]
@@ -139,6 +141,7 @@ mod signal {
     // This definition is not as accurate as it could be, {pid, uid, status} is
     // actually a giant union. Currently we're only interested in these fields,
     // however.
+    #[repr(C)]
     pub struct siginfo {
         si_signo: libc::c_int,
         si_errno: libc::c_int,
@@ -148,6 +151,7 @@ mod signal {
         pub status: libc::c_int,
     }
 
+    #[repr(C)]
     pub struct sigaction {
         pub sa_handler: extern fn(libc::c_int),
         pub sa_mask: sigset_t,
@@ -155,10 +159,13 @@ mod signal {
         sa_restorer: *mut libc::c_void,
     }
 
+    #[repr(C)]
     #[cfg(target_word_size = "32")]
     pub struct sigset_t {
         __val: [libc::c_ulong, ..32],
     }
+
+    #[repr(C)]
     #[cfg(target_word_size = "64")]
     pub struct sigset_t {
         __val: [libc::c_ulong, ..16],
@@ -182,6 +189,7 @@ mod signal {
     // This definition is not as accurate as it could be, {pid, uid, status} is
     // actually a giant union. Currently we're only interested in these fields,
     // however.
+    #[repr(C)]
     pub struct siginfo {
         si_signo: libc::c_int,
         si_code: libc::c_int,
@@ -191,6 +199,7 @@ mod signal {
         pub status: libc::c_int,
     }
 
+    #[repr(C)]
     pub struct sigaction {
         pub sa_flags: libc::c_uint,
         pub sa_handler: extern fn(libc::c_int),
@@ -199,6 +208,7 @@ mod signal {
         sa_resv: [libc::c_int, ..1],
     }
 
+    #[repr(C)]
     pub struct sigset_t {
         __val: [libc::c_ulong, ..32],
     }
@@ -231,6 +241,7 @@ mod signal {
 
     // This structure has more fields, but we're not all that interested in
     // them.
+    #[repr(C)]
     pub struct siginfo {
         pub si_signo: libc::c_int,
         pub si_errno: libc::c_int,
@@ -242,6 +253,7 @@ mod signal {
 
     #[cfg(target_os = "macos")]
     #[cfg(target_os = "ios")]
+    #[repr(C)]
     pub struct sigaction {
         pub sa_handler: extern fn(libc::c_int),
         sa_tramp: *mut libc::c_void,
@@ -251,6 +263,7 @@ mod signal {
 
     #[cfg(target_os = "freebsd")]
     #[cfg(target_os = "dragonfly")]
+    #[repr(C)]
     pub struct sigaction {
         pub sa_handler: extern fn(libc::c_int),
         pub sa_flags: libc::c_int,