Make C primitives reexports instead of type aliases

This commit is contained in:
David Tolnay 2022-07-07 17:09:51 -07:00
parent 24d4a7671a
commit 501b058987
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
3 changed files with 5 additions and 12 deletions

View file

@ -11,7 +11,6 @@ use crate::{libc, yaml_document_delete, yaml_emitter_emit, yaml_free, yaml_mallo
use core::mem::{size_of, MaybeUninit};
use core::ptr::{self, addr_of_mut};
use core::slice;
use std::io::Write;
pub unsafe fn yaml_emitter_open(mut emitter: *mut yaml_emitter_t) -> libc::c_int {
let mut event = MaybeUninit::<yaml_event_t>::uninit();
let event = event.as_mut_ptr();

View file

@ -31,14 +31,10 @@ use core::mem::size_of;
pub mod libc {
pub use core::ffi::c_void;
pub type c_char = i8;
pub type c_int = i32;
pub type c_long = i64;
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_uint = u32;
pub type c_ulong = u64;
pub type c_ushort = u16;
pub use core::primitive::{
i32 as c_int, i64 as c_long, i8 as c_char, i8 as c_schar, u16 as c_ushort, u32 as c_uint,
u64 as c_ulong, u8 as c_uchar,
};
}
#[macro_use]

View file

@ -1,6 +1,5 @@
use crate::libc;
pub type size_t = libc::c_ulong;
pub type yaml_char_t = libc::c_uchar;
pub use core::primitive::{i64 as ptrdiff_t, u64 as size_t, u8 as yaml_char_t};
#[derive(Copy, Clone)]
#[repr(C)]
#[non_exhaustive]
@ -762,4 +761,3 @@ pub struct yaml_string_t {
pub end: *mut yaml_char_t,
pub pointer: *mut yaml_char_t,
}
pub type ptrdiff_t = libc::c_long;