verify POSIX header includes

This commit is contained in:
auronandace
2026-06-08 18:27:53 +01:00
parent 227e736836
commit 9ea36a0c6c
27 changed files with 23 additions and 36 deletions
+4 -5
View File
@@ -11,16 +11,15 @@
# - including netinet/in.h in arpa/inet.h
# - splitting out functions (htonl, htons, ntohl, ntohs) into bits/arpainet.h
#
# features.h needed for #[deprecated] annotation
# bits/arpainet.h brings in inttypes.h
sys_includes = ["features.h", "netinet/in.h"]
# features.h needed for deprecated annotation
sys_includes = ["netinet/in.h", "features.h"]
include_guard = "_RELIBC_ARPA_INET_H"
after_includes = """
#include <bits/arpainet.h> // for htonl, htons, ntohl, ntohs
#include <bits/socklen-t.h> // for socklen_t
#include <bits/arpainet.h> // for htonl, htons, ntohl, ntohs
#include <bits/socklen-t.h> // for socklen_t from sys/socket.h
"""
language = "C"
style = "Tag"
no_includes = true
cpp_compat = true
-2
View File
@@ -1,14 +1,12 @@
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/cpio.h.html
#
# There are no spec quotations relating to includes
sys_includes = []
include_guard = "_RELIBC_CPIO_H"
# cbindgen still can't handle exporting CStr
after_includes = """
#define MAGIC "070707"
"""
language = "C"
style = "Type"
no_includes = true
cpp_compat = true
-1
View File
@@ -2,7 +2,6 @@
#
# Spec quotations relating to includes:
# - "The <dirent.h> header shall define the ino_t, reclen_t, size_t, and ssize_t types as described in <sys/types.h>."
sys_includes = []
include_guard = "_RELIBC_DIRENT_H"
language = "C"
style = "Both"
-1
View File
@@ -1,7 +1,6 @@
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/dlfcn.h.html
#
# There are no spec quotations relating to includes
sys_includes = []
include_guard = "_RELIBC_DLFCN_H"
language = "C"
style = "Type"
-2
View File
@@ -1,7 +1,6 @@
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/errno.h.html
#
# There are no spec quotations relating to includes
sys_includes = []
after_includes = """
#define errno (*__errno_location())
#define program_invocation_name (*__program_invocation_name())
@@ -9,7 +8,6 @@ after_includes = """
"""
include_guard = "_RELIBC_ERRNO_H"
language = "C"
style = "Tag"
no_includes = true
cpp_compat = true
+2
View File
@@ -9,6 +9,8 @@
# To prevent a cycle between fcntl.h and unistd.h relibc only includes fcntl.h in unistd.h.
# This approach was chosen because unistd.h requires parts of fcntl.h but not the other way around.
#
# TODO split out va_list from stdarg.h
#
# stdarg.h brings in va_list for ...
# sys/stat.h brings in mode_t, off_t and file mode constants
sys_includes = ["stdarg.h", "sys/stat.h"]
-1
View File
@@ -2,7 +2,6 @@
#
# Spec quotations relating to includes:
# - "The <glob.h> header shall define the size_t type as described in <sys/types.h>."
sys_includes = []
after_includes = """
#include <bits/size-t.h> // for size_t from sys/types.h
"""
-1
View File
@@ -2,7 +2,6 @@
#
# Spec quotations relating to includes:
# - "The <grp.h> header shall define the gid_t and size_t types as described in <sys/types.h>."
sys_includes = []
after_includes = """
#include <bits/gid-t.h> // for gid_t from sys/types.h
#include <bits/size-t.h> // for size_t from sys/types.h
-2
View File
@@ -1,10 +1,8 @@
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/libgen.h.html
#
# There are no spec quotations relating to includes
sys_includes = []
include_guard = "_RELIBC_LIBGEN_H"
language = "C"
style = "Tag"
no_includes = true
cpp_compat = true
-2
View File
@@ -1,13 +1,11 @@
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/limits.h.html
#
# There are no spec quotations relating to includes
sys_includes = []
after_includes = """
#include <bits/ssize-t.h> // for ssize_t from sys/types.h
"""
include_guard = "_RELIBC_LIMITS_H"
language = "C"
style = "Tag"
no_includes = true
cpp_compat = true
+5 -3
View File
@@ -1,8 +1,10 @@
# Note: changing this file requires `make clean`.
sys_includes = []
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/math.h.html
#
# There are no spec quotations relating to includes
#
# NOTE: changing this file requires `make clean`.
include_guard = "_RELIBC_MATH_H"
language = "C"
style = "Type"
no_includes = true
cpp_compat = true
# constants from openlibm
-1
View File
@@ -4,7 +4,6 @@
# - "The <monetary.h> header shall define the locale_t type as described in <locale.h>."
# - "The <monetary.h> header shall define the size_t type as described in <stddef.h>."
# - "The <monetary.h> header shall define the ssize_t type as described in <sys/types.h>."
sys_includes = []
include_guard = "_RELIBC_MONETARY_H"
after_includes = """
#include <bits/locale-t.h> // for locale_t from locale.h
-2
View File
@@ -1,10 +1,8 @@
# POSIX header spec: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/netinet_tcp.h.html
#
# There are no spec quotations relating to includes
sys_includes = []
include_guard = "_RELIBC_NETINET_TCP_H"
language = "C"
style = "Tag"
no_includes = true
cpp_compat = true
-1
View File
@@ -4,7 +4,6 @@
# - "The <poll.h> header shall define the sigset_t type as described in <signal.h>."
# - "The <poll.h> header shall define the timespec structure as described in <time.h>."
# - "Inclusion of the <poll.h> header may make visible all symbols from the headers <signal.h> and <time.h>."
sys_includes = []
include_guard = "_RELIBC_POLL_H"
after_includes = """
#include <bits/sigset-t.h> // for sigset_t from signal.h
-1
View File
@@ -2,7 +2,6 @@
#
# Spec quotations relating to includes:
# - "The <pwd.h> header shall define the gid_t, uid_t, and size_t types as described in <sys/types.h>."
sys_includes = []
after_includes = """
#include <bits/gid-t.h> // for gid_t from sys/types.h
#include <bits/size-t.h> // for size_t from sys/types.h
-1
View File
@@ -2,7 +2,6 @@
#
# Spec quotations relating to includes:
# - "The <regex.h> header shall define the size_t type as described in <sys/types.h>."
sys_includes = []
after_includes = """
#include <bits/size-t.h> // for size_t from sys/types.h
"""
-1
View File
@@ -7,7 +7,6 @@
# - "Inclusion of the <sched.h> header may make visible all symbols from the <time.h> header."
#
# bits/timespec.h brings in time_t
sys_includes = []
include_guard = "_RELIBC_SCHED_H"
after_includes = """
#include <bits/pid-t.h> // for pid_t from sys/types
+2
View File
@@ -11,6 +11,8 @@
# POSIX states signal.h may include time.h and time.h may include signal.h.
# To prevent a cycle between both headers we only import the needed types through bits.
#
# TODO split out types from bits/pthread.h
#
# features.h required for deprecated annotations
sys_includes = ["features.h"]
include_guard = "_RELIBC_SIGNAL_H"
+2
View File
@@ -4,6 +4,8 @@
# - "The <sys/shm.h> header shall define the type intptr_t as described in <stdint.h>."
# - "The <sys/shm.h> header shall define the pid_t, size_t, and time_t types as described in <sys/types.h>."
# - "In addition, the <sys/shm.h> header shall include the <sys/ipc.h> header."
#
# TODO split out intptr_t from stdint.h
sys_includes = ["sys/ipc.h", "stdint.h"]
include_guard = "_RELIBC_SYS_SHM_H"
after_includes = """
+2
View File
@@ -5,6 +5,8 @@
# - "The <sys/socket.h> header shall define the size_t and ssize_t types as described in <sys/types.h>."
# - "Inclusion of <sys/socket.h> may also make visible all symbols from <sys/uio.h>."
#
# TODO split out uint32_t from stdint.h in bits/socklen-t.h
#
# bits/iovec.h brings in size_t
# bits/socklen_t brings in stdint.h for uint32_t for socklen_t
include_guard = "_RELIBC_SYS_SOCKET_H"
-1
View File
@@ -6,7 +6,6 @@
# - "Inclusion of the <sys/stat.h> header may make visible all symbols from the <time.h> header."
#
# bits/timespec.h brings in time_t
sys_includes = []
include_guard = "_RELIBC_SYS_STAT_H"
after_includes = """
#include <bits/sys/stat.h> // for blkcnt_t and blksize_t from sys/types.h
-1
View File
@@ -2,7 +2,6 @@
#
# Spec quotations relating to includes:
# - "The <sys/statvfs.h> header shall define the fsblkcnt_t and fsfilcnt_t types as described in <sys/types.h>."
sys_includes = []
after_includes = """
#include <bits/sys/statvfs.h> // for fsblkcnt_t and fsfilcnt_t from sys/types.h
"""
+2 -3
View File
@@ -2,7 +2,7 @@
#
# There are no spec quotations relating to includes
#
# - sys/types/internal.h are fundamental C types (which includes stddef.h)
# - sys/types/internal.h are fundamental C types
# - sys/types/internal.h brings in features.h for deprecated annotations for useconds_t
# - bits/pthread.h is separate for convenience
sys_includes = [
@@ -10,10 +10,9 @@ sys_includes = [
"sys/types/internal.h",
"bits/pthread.h",
]
include_guard = "_SYS_TYPES_H"
include_guard = "_RELIBC_SYS_TYPES_H"
no_includes = true
language = "C"
style = "Tag"
[enum]
prefix_with_name = true
-2
View File
@@ -4,7 +4,6 @@
# - "The <sys/uio.h> header shall define the ssize_t and size_t types as described in <sys/types.h>."
#
# bits/iovec.h brings in size_t
sys_includes = []
after_includes = """
#include <bits/ssize-t.h> // for ssize_t from sys/types.h
#include <bits/iovec.h> // for iovec
@@ -14,7 +13,6 @@ after_includes = """
"""
include_guard = "_RELIBC_SYS_UIO_H"
language = "C"
style = "Tag"
no_includes = true
cpp_compat = true
-1
View File
@@ -2,7 +2,6 @@
#
# Spec quotations relating to includes:
# - "The <sys/un.h> header shall define the sa_family_t type as described in <sys/socket.h>."
sys_includes = []
after_includes = """
#include <bits/safamily-t.h> // for sa_family_t from sys/socket.h
"""
-1
View File
@@ -2,7 +2,6 @@
#
# Spec quotations relating to includes:
# - "The <termios.h> header shall define the pid_t type as described in <sys/types.h>."
sys_includes = []
after_includes = """
#include <bits/pid-t.h> // for pid_t from sys/types.h
#include <bits/winsize.h> // for winsize
+4
View File
@@ -9,6 +9,10 @@
# - "NULL As described in <stddef.h>."
# - "Inclusion of the <time.h> header may make visible all symbols from the <signal.h> header."
#
# Cycle warning:
# POSIX states signal.h may include time.h and time.h may include signal.h.
# To prevent a cycle between both headers we only import the needed types through bits.
#
# bits/timespec.h brings in time_t
# features.h included for deprecated annotations
sys_includes = ["features.h"]