2014-02-07 13:08:32 -06:00
|
|
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
2012-12-10 19:32:48 -06:00
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-10-10 15:40:17 -05:00
|
|
|
// Issue #3656
|
|
|
|
// Incorrect struct size computation in the FFI, because of not taking
|
|
|
|
// the alignment of elements into account.
|
|
|
|
|
2015-03-05 20:33:58 -06:00
|
|
|
#![feature(libc)]
|
|
|
|
|
2014-02-26 11:58:41 -06:00
|
|
|
extern crate libc;
|
|
|
|
use libc::{c_uint, uint32_t, c_void};
|
2012-10-10 15:40:17 -05:00
|
|
|
|
2014-09-19 14:30:07 -05:00
|
|
|
pub struct KEYGEN {
|
2014-12-19 20:20:51 -06:00
|
|
|
hash_algorithm: [c_uint; 2],
|
2012-10-10 15:40:17 -05:00
|
|
|
count: uint32_t,
|
2014-06-25 14:47:34 -05:00
|
|
|
salt: *const c_void,
|
2012-10-10 15:40:17 -05:00
|
|
|
salt_size: uint32_t,
|
|
|
|
}
|
|
|
|
|
|
|
|
extern {
|
|
|
|
// Bogus signature, just need to test if it compiles.
|
2013-05-07 23:33:31 -05:00
|
|
|
pub fn malloc(data: KEYGEN);
|
2012-10-10 15:40:17 -05:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2012-10-10 15:40:17 -05:00
|
|
|
}
|