Skip to content

Commit 31a4041

Browse files
committed
remove system headers
1 parent 8e167c6 commit 31a4041

File tree

2 files changed

+44
-2
lines changed

2 files changed

+44
-2
lines changed

tests/expectations/tests/attributes.rs

+42
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![allow(non_snake_case)]
55

66

7+
pub const RTE_CACHE_LINE_SIZE: ::std::os::raw::c_uint = 64;
78
#[doc = "__attribute__(aligned(16))"]
89
pub const x: ::std::os::raw::c_int = 0;
910
#[repr(C)]
@@ -47,3 +48,44 @@ extern "C" {
4748
#[link_name = "_Z5fatalv"]
4849
pub fn fatal();
4950
}
51+
/**
52+
* The generic rte_mbuf, containing a packet mbuf.
53+
*/
54+
#[doc = "__attribute__(__aligned__(a))"]
55+
#[repr(C)]
56+
#[derive(Debug, Copy)]
57+
pub struct rte_mbuf {
58+
/** Timesync flags for use with IEEE1588. */
59+
pub timesync: u16,
60+
}
61+
impl Clone for rte_mbuf {
62+
fn clone(&self) -> Self { *self }
63+
}
64+
/**
65+
* Physical memory segment descriptor.
66+
*/
67+
#[repr(C, packed)]
68+
#[derive(Debug, Copy)]
69+
pub struct rte_memseg {
70+
/**< Number of channels. */
71+
pub nchannel: u32,
72+
/**< Number of ranks. */
73+
pub nrank: u32,
74+
}
75+
#[test]
76+
fn bindgen_test_layout_rte_memseg() {
77+
assert_eq!(::std::mem::size_of::<rte_memseg>() , 8usize);
78+
assert_eq!(::std::mem::align_of::<rte_memseg>() , 1usize);
79+
}
80+
impl Clone for rte_memseg {
81+
fn clone(&self) -> Self { *self }
82+
}
83+
#[doc = "__attribute__(aligned(2*sizeof(longlong)))"]
84+
#[repr(C)]
85+
#[derive(Debug, Copy)]
86+
pub struct align {
87+
pub foo: ::std::os::raw::c_int,
88+
}
89+
impl Clone for align {
90+
fn clone(&self) -> Self { *self }
91+
}

tests/headers/attributes.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include <stdint.h>
2-
#include <stddef.h>
1+
typedef unsigned short uint16_t;
2+
typedef unsigned int uint32_t;
33

44
int x __attribute__ ((aligned (16))) = 0;
55

0 commit comments

Comments
 (0)