split out NULL from stddef header
This commit is contained in:
+1
-2
@@ -14,8 +14,7 @@
|
||||
#endif // _WCHAR_T
|
||||
|
||||
#include <bits/size-t.h>
|
||||
|
||||
#define NULL 0
|
||||
#include <bits/null.h>
|
||||
|
||||
#ifndef __PTRDIFF_TYPE__
|
||||
#define __PTRDIFF_TYPE__ long int
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# 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 other headers.
|
||||
#
|
||||
# POSIX headers that require NULL (without the rest of stddef.h):
|
||||
# - locale.h
|
||||
# - stddef.h (where it should be defined)
|
||||
# - time.h
|
||||
include_guard = "_RELIBC_BITS_NULL_T_H"
|
||||
language = "C"
|
||||
no_includes = true
|
||||
@@ -0,0 +1,5 @@
|
||||
use crate::platform::types::c_void;
|
||||
|
||||
/// Null pointer constant.
|
||||
#[expect(clippy::zero_ptr)]
|
||||
pub const NULL: *mut c_void = 0 as *mut c_void;
|
||||
@@ -2,10 +2,10 @@
|
||||
#
|
||||
# Spec quotations relating to includes:
|
||||
# - "The <locale.h> header shall define NULL (as described in <stddef.h>) and at least the following as macros:"
|
||||
sys_includes = ["stddef.h"]
|
||||
include_guard = "_RELIBC_LOCALE_H"
|
||||
after_includes = """
|
||||
#include <bits/locale-t.h> // for locale_t
|
||||
#include <bits/null.h> // for NULL from stddef.h
|
||||
"""
|
||||
language = "C"
|
||||
style = "Tag"
|
||||
|
||||
@@ -26,6 +26,7 @@ pub mod bits_locale_t;
|
||||
pub mod bits_mode_t;
|
||||
#[path = "bits_nlink-t/mod.rs"]
|
||||
pub mod bits_nlink_t;
|
||||
pub mod bits_null;
|
||||
#[path = "bits_off-t/mod.rs"]
|
||||
pub mod bits_off_t;
|
||||
#[path = "bits_pid-t/mod.rs"]
|
||||
|
||||
@@ -9,16 +9,17 @@
|
||||
# - "NULL As described in <stddef.h>."
|
||||
# - "Inclusion of the <time.h> header may make visible all symbols from the <signal.h> header."
|
||||
#
|
||||
# stddef.h brings in size_t and NULL
|
||||
# bits/timespec.h brings in time_t
|
||||
# features.h included for deprecated annotations
|
||||
sys_includes = ["stddef.h", "features.h"]
|
||||
sys_includes = ["features.h"]
|
||||
include_guard = "_RELIBC_TIME_H"
|
||||
language = "C"
|
||||
style = "Tag"
|
||||
no_includes = true
|
||||
cpp_compat = true
|
||||
after_includes = """
|
||||
#include <bits/null.h> // for NULL from stddef.h
|
||||
#include <bits/size-t.h> // for size_t from sys/types.h
|
||||
#include <bits/clock-t.h> // for clock_t from sys/types.h
|
||||
#include <bits/clockid-t.h> // for clockid_t from sys/types.h
|
||||
#include <bits/pid-t.h> // for pid_t from sys/types.h
|
||||
|
||||
Reference in New Issue
Block a user