std: uv::ll fixes for 32bit linux

This commit is contained in:
Jeff Olson 2012-06-29 07:06:32 -07:00 committed by Brian Anderson
parent 087c4244b1
commit a3c933e0a0
2 changed files with 54 additions and 13 deletions

View File

@ -225,12 +225,12 @@ enum uv_handle_type {
// 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,
@ -240,16 +240,59 @@ enum uv_handle_type {
// 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 = {

View File

@ -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;
}