Skip to content

Commit

Permalink
std: uv::ll fixes for 32bit linux
Browse files Browse the repository at this point in the history
  • Loading branch information
olsonjeffery authored and brson committed Jun 29, 2012
1 parent 087c424 commit a3c933e
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 13 deletions.
65 changes: 54 additions & 11 deletions src/libstd/uv_ll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,12 @@ type sockaddr_in = {

// unix size: 28 .. FIXME #1645
// stuck with 32 becuse of rust padding structs?
#[cfg(unix)]
#[cfg(target_arch="x86_64")]
type sockaddr_in6 = {
a0: *u8, a1: *u8,
a2: *u8, a3: *u8
};
#[cfg(windows)]
#[cfg(target_arch="x86")]
type sockaddr_in6 = {
a0: *u8, a1: *u8,
a2: *u8, a3: *u8,
Expand All @@ -240,16 +240,59 @@ type sockaddr_in6 = {

// unix size: 28 .. FIXME #1645
// stuck with 32 becuse of rust padding structs?
type addr_in = {
a0: *u8, a1: *u8,
a2: *u8, a3: *u8
};
type addr_in = addr_in_impl::addr_in;
#[cfg(unix)]
mod addr_in_impl {
#[cfg(target_arch="x86_64")]
type addr_in = {
a0: *u8, a1: *u8,
a2: *u8, a3: *u8
};
#[cfg(target_arch="x86")]
type addr_in = {
a0: *u8, a1: *u8,
a2: *u8, a3: *u8,
a4: *u8, a5: *u8,
a6: *u8, a7: *u8,
};
}
#[cfg(windows)]
mod addr_in_impl {
type addr_in = {
a0: *u8, a1: *u8,
a2: *u8, a3: *u8
};
}

// unix size: 48
type addrinfo = {
a00: *u8, a01: *u8, a02: *u8, a03: *u8,
a04: *u8, a05: *u8
};
// unix size: 48, 32bit: 32
type addrinfo = addrinfo_impl::addrinfo;
#[cfg(target_os="linux")]
mod addrinfo_impl {
#[cfg(target_arch="x86_64")]
type addrinfo = {
a00: *u8, a01: *u8, a02: *u8, a03: *u8,
a04: *u8, a05: *u8
};
#[cfg(target_arch="x86")]
type addrinfo = {
a00: *u8, a01: *u8, a02: *u8, a03: *u8,
a04: *u8, a05: *u8, a06: *u8, a07: *u8
};
}
#[cfg(target_os="macos")]
mod addrinfo_impl {
type addrinfo = {
a00: *u8, a01: *u8, a02: *u8, a03: *u8,
a04: *u8, a05: *u8
};
}
#[cfg(windows)]
mod addrinfo_impl {
type addrinfo = {
a00: *u8, a01: *u8, a02: *u8, a03: *u8,
a04: *u8, a05: *u8
};
}

// unix size: 72
type uv_getaddrinfo_t = {
Expand Down
2 changes: 0 additions & 2 deletions src/rt/rust_uv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,6 @@ rust_uv_ip4_name(struct sockaddr_in* src, char* dst, size_t size) {
extern "C" int
rust_uv_ip6_name(struct sockaddr_in6* src, char* dst, size_t size) {
int result = uv_ip6_name(src, dst, size);
printf("rust_uv_ip6_name: src ptr: %lu dst result: '%s'\n",
(unsigned long int)src, dst);
return result;
}

Expand Down

0 comments on commit a3c933e

Please sign in to comment.