diff --git a/src/header/bits_locale-t/cbindgen.toml b/src/header/bits_locale-t/cbindgen.toml new file mode 100644 index 0000000000..7fcb468604 --- /dev/null +++ b/src/header/bits_locale-t/cbindgen.toml @@ -0,0 +1,14 @@ +sys_includes = [] +include_guard = "_RELIBC_BITS_LOCALE_T_H" +language = "C" +style = "type" +no_includes = true +cpp_compat = true + +[export] +include = [ + "locale_t" +] + +[enum] +prefix_with_name = true diff --git a/src/header/bits_locale-t/mod.rs b/src/header/bits_locale-t/mod.rs new file mode 100644 index 0000000000..0e1c4c3611 --- /dev/null +++ b/src/header/bits_locale-t/mod.rs @@ -0,0 +1 @@ +pub type locale_t = *mut core::ffi::c_void; diff --git a/src/header/locale/cbindgen.toml b/src/header/locale/cbindgen.toml index edb2300b9c..f373d74a7e 100644 --- a/src/header/locale/cbindgen.toml +++ b/src/header/locale/cbindgen.toml @@ -1,4 +1,7 @@ include_guard = "_RELIBC_LOCALE_H" +after_includes = """ +#include // for locale_t +""" trailer = "#include " language = "C" style = "Tag" diff --git a/src/header/locale/mod.rs b/src/header/locale/mod.rs index 25b9ffb06d..0f135f11d2 100644 --- a/src/header/locale/mod.rs +++ b/src/header/locale/mod.rs @@ -27,7 +27,7 @@ use constants::*; mod data; use data::*; -pub type locale_t = *mut c_void; +use super::bits_locale_t::locale_t; /// constant struct to "C" or "POSIX" locale /// mutable because POSIX demands a mutable pointer static mut POSIX_LOCALE: lconv = posix_lconv(); diff --git a/src/header/mod.rs b/src/header/mod.rs index c01b384ebc..1817eead88 100644 --- a/src/header/mod.rs +++ b/src/header/mod.rs @@ -4,6 +4,8 @@ pub mod _aio; pub mod _fenv; pub mod arpa_inet; pub mod assert; +#[path = "bits_locale-t/mod.rs"] +pub mod bits_locale_t; pub mod bits_pthread; pub mod bits_sched; // complex.h implemented in C diff --git a/src/header/string/cbindgen.toml b/src/header/string/cbindgen.toml index d5ae1e23b7..e87cd7e152 100644 --- a/src/header/string/cbindgen.toml +++ b/src/header/string/cbindgen.toml @@ -1,5 +1,8 @@ -sys_includes = ["stddef.h", "stdint.h", "strings.h", "locale.h"] +sys_includes = ["stddef.h", "stdint.h", "strings.h"] include_guard = "_RELIBC_STRING_H" +after_includes = """ +#include // for locale_t +""" language = "C" style = "Tag" no_includes = true diff --git a/src/header/string/mod.rs b/src/header/string/mod.rs index e1c2c2478b..9a699c8b3d 100644 --- a/src/header/string/mod.rs +++ b/src/header/string/mod.rs @@ -20,7 +20,7 @@ use crate::{ raw_cell::RawCell, }; -use super::locale::{THREAD_LOCALE, locale_t}; +use super::{bits_locale_t::locale_t, locale::THREAD_LOCALE}; /// See . ///