split out wchar_t from stddef header
This commit is contained in:
+1
-10
@@ -3,16 +3,7 @@
|
||||
|
||||
// wchar_t should come before NULL and size_t
|
||||
// according to comment in wchar cbindgen
|
||||
#ifndef _WCHAR_T
|
||||
#define _WCHAR_T
|
||||
#ifndef __cplusplus
|
||||
#ifndef __WCHAR_TYPE__
|
||||
#define __WCHAR_TYPE__ int
|
||||
#endif
|
||||
typedef __WCHAR_TYPE__ wchar_t;
|
||||
#endif // __cplusplus
|
||||
#endif // _WCHAR_T
|
||||
|
||||
#include <bits/wchar-t.h>
|
||||
#include <bits/size-t.h>
|
||||
#include <bits/null.h>
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/stddef.h.html
|
||||
#
|
||||
# This type is split out to prevent importing all of stddef.h into inttypes.h
|
||||
include_guard = "_RELIBC_BITS_WCHAR_T_H"
|
||||
after_includes = """
|
||||
#ifndef _WCHAR_T
|
||||
#define _WCHAR_T
|
||||
#ifndef __cplusplus
|
||||
#ifndef __WCHAR_TYPE__
|
||||
#define __WCHAR_TYPE__ int
|
||||
#endif
|
||||
typedef __WCHAR_TYPE__ wchar_t;
|
||||
#endif // __cplusplus
|
||||
#endif // _WCHAR_T
|
||||
"""
|
||||
language = "C"
|
||||
no_includes = true
|
||||
cpp_compat = true
|
||||
@@ -0,0 +1 @@
|
||||
// `wchar_t` is defined in cbindgen
|
||||
@@ -3,10 +3,10 @@
|
||||
# Spec quotations relating to includes:
|
||||
# - "The <inttypes.h> header shall include the <stdint.h> header."
|
||||
# - "wchar_t As described in <stddef.h>."
|
||||
#
|
||||
# TODO possibly split out wchar_t to avoid including all of stddef.h
|
||||
# stddef.h also currently includes stdint.h but shouldn't according to the spec
|
||||
sys_includes = ["stdint.h", "stddef.h"]
|
||||
sys_includes = ["stdint.h"]
|
||||
after_includes = """
|
||||
#include <bits/wchar-t.h> // for wchar_t from stddef.h
|
||||
"""
|
||||
include_guard = "_RELIBC_INTTYPES_H"
|
||||
trailer = """
|
||||
#ifndef _RELIBC_BITS_INTTYPES_H
|
||||
|
||||
@@ -58,6 +58,8 @@ pub mod bits_timeval;
|
||||
pub mod bits_uid_t;
|
||||
#[path = "bits_useconds-t/mod.rs"]
|
||||
pub mod bits_useconds_t;
|
||||
#[path = "bits_wchar-t/mod.rs"]
|
||||
pub mod bits_wchar_t;
|
||||
pub mod bits_winsize;
|
||||
// complex.h implemented in C (currently through openlibm)
|
||||
pub mod cpio;
|
||||
|
||||
Reference in New Issue
Block a user