Fix definition of c::long for 64-bit non-Windows platforms.

This commit is contained in:
Brian Smith 2016-11-22 18:31:11 -10:00
parent f014d94af6
commit dcba8a845f

View File

@ -81,9 +81,19 @@ macro_rules! define_metrics_tests {
define_type!(int, i32, test_int_metrics, GFp_int_align, GFp_int_size,
"The C `int` type. Equivalent to `libc::c_int`.");
#[cfg(any(target_os = "windows", target_pointer_width = "32"))]
define_type!(long, i32, test_long_metrics, GFp_long_align, GFp_long_size,
"The C `long` type. Equivalent to `libc::c_long`.");
#[cfg(not(any(target_os = "windows", target_pointer_width = "32")))]
type long = i64;
#[cfg(not(any(target_os = "windows", target_pointer_width = "32")))]
define_metrics_tests!(long, test_long_metrics, GFp_long_align,
GFp_long_size, SIXTY_FOUR_BIT_ALIGNMENT_FACTOR);
define_type!(
size_t, usize, test_size_t_metrics, GFp_size_t_align, GFp_size_t_size,
"The C `size_t` type from `<stdint.h>`.