mirror-llvm-project/libc/include
Pavel Labath 2bd8d73902
[libc] Add public_includes stanza to hdrgen and use it in socket headers (#205543)
This patch adds support for a public_includes stanza in header YAML
files, allowing generated public headers to include other public
headers.

I use this to make arpa/inet.h include netinet/in.h, and netinet/in.h
include sys/socket.h. While POSIX doesn't strictly require these headers
to include each other, it permits it, and many real-world applications
depend on this behavior.

To make this work, I also needed to reorder the header targets in
include/CMakeLists.txt so that targets sys_socket and netinet_in are
defined before targets declare dependencies on them.

There are a couple of other files that could use this feature (right now
they handle it through the header template), but I'll do that as a
separate patch.

Assisted by Gemini.
2026-06-29 08:13:17 +02:00
..
arpa [libc] Add public_includes stanza to hdrgen and use it in socket headers (#205543) 2026-06-29 08:13:17 +02:00
llvm-libc-macros [libc] introduce shared compiler-rt builtins (#200094) 2026-06-26 19:20:27 +03:00
llvm-libc-types [libc] Add IPv4 socket options and related structs (#204787) 2026-06-24 11:17:03 +02:00
netinet [libc] Add public_includes stanza to hdrgen and use it in socket headers (#205543) 2026-06-29 08:13:17 +02:00
sys [libc] Add loff_t type (#204641) 2026-06-23 16:46:14 +00:00
__llvm-libc-common.h [libc] Remove unused _Thread_local define from headers. (#156967) 2025-09-04 14:02:43 -07:00
assert.h.def
assert.yaml
byteswap.yaml [libc] Add byteswap.h header with bswap_16/bswap_32/bswap_64 (#196278) 2026-05-07 14:33:33 +01:00
CMakeLists.txt [libc] Add public_includes stanza to hdrgen and use it in socket headers (#205543) 2026-06-29 08:13:17 +02:00
complex.yaml [libc][complex] Add cargf and carg functions to libc complex math (#204087) 2026-06-25 10:07:13 +08:00
cpio.yaml [libc] Add missing POSIX macros to cpio.h (#188840) 2026-03-27 22:08:13 +00:00
ctype.yaml [libc][NFC] Lowercase standard identifiers in YAML files (#198854) 2026-05-21 06:48:03 +01:00
dirent.yaml [libc] Remove trivial .h.def files (#149466) 2025-07-18 11:35:09 -07:00
dlfcn.yaml [libc][NFC] Lowercase standard identifiers in YAML files (#198854) 2026-05-21 06:48:03 +01:00
elf.yaml [libc] Add some more segment type macros 2026-04-22 15:22:30 -07:00
endian.yaml [libc] Remove more header template files (#189066) 2026-03-27 16:06:39 -07:00
errno.h.def [libc] Define Annex K's errno_t in specified headers (#187700) 2026-03-25 12:30:19 +00:00
errno.yaml [libc][NFC] Lowercase standard identifiers in YAML files (#198854) 2026-05-21 06:48:03 +01:00
fcntl.yaml [libc][NFC] Lowercase standard identifiers in YAML files (#198854) 2026-05-21 06:48:03 +01:00
features.yaml [libc] Remove more header template files (#189066) 2026-03-27 16:06:39 -07:00
fenv.yaml
float.yaml [libc] Remove more header template files (#189066) 2026-03-27 16:06:39 -07:00
htons-family.yaml [libc] Add the htons function family to netinet/in.h (#203028) 2026-06-11 12:14:36 +02:00
inttypes.yaml [libc] implement wcstoimax/wcstoumax (#200284) 2026-06-03 17:03:50 -07:00
libgen.yaml Reland "[libc] Implement basename and dirname in libgen.h #204554" (#205352) 2026-06-23 15:59:59 +01:00
limits.yaml [libc] Define SSIZE_MAX in limits-macros.h (#201087) 2026-06-02 13:27:32 +01:00
link.h.def [libc] Provide a minimal implementation of elf.h (#172766) 2026-01-12 10:56:49 -08:00
link.yaml [libc] Provide a minimal implementation of elf.h (#172766) 2026-01-12 10:56:49 -08:00
locale.yaml [libc] Remove header templates from several C standard headers. (#188878) 2026-03-27 17:55:37 +00:00
malloc.yaml
math.h.def
math.yaml [libc][math][c23] Implement higher math function cbrtf16 in LLVM libc (#132484) 2026-06-15 22:10:19 +00:00
nl_types.yaml [libc][docs] Fix docgen macro lookup for underscored headers (#194367) 2026-04-30 10:24:43 -07:00
poll.yaml [libc] Remove yet another batch of header template files (#191067) 2026-04-08 15:56:41 -07:00
pthread.yaml [libc] Enforce standard identifier validation in hdrgen (#198971) 2026-05-22 07:48:44 +01:00
regex.yaml [libc] Add POSIX regex stub implementation and build infrastructure (#196995) 2026-05-18 16:15:18 +01:00
sched.yaml [libc] Add CPU_CLR(_S) macros (#204590) 2026-06-23 15:41:55 +02:00
search.yaml [libc] Enforce standard identifier validation in hdrgen (#198971) 2026-05-22 07:48:44 +01:00
setjmp.yaml [libc] Remove trivial .h.def files (#149466) 2025-07-18 11:35:09 -07:00
signal.yaml [libc][NFC] Lowercase standard identifiers in YAML files (#198854) 2026-05-21 06:48:03 +01:00
spawn.yaml [libc] Remove trivial .h.def files (#149466) 2025-07-18 11:35:09 -07:00
stdbit.h.def
stdbit.yaml
stdckdint.yaml [libc] Remove more header template files (#189066) 2026-03-27 16:06:39 -07:00
stdfix.h.def
stdfix.yaml [libc] Enforce standard identifier validation in hdrgen (#198971) 2026-05-22 07:48:44 +01:00
stdint.yaml [libc] Remove more header template files (#189066) 2026-03-27 16:06:39 -07:00
stdio.yaml [libc] Add explicit format attributes for modular printf (#201212) 2026-06-03 09:21:33 -07:00
stdlib-malloc.yaml [libc] Declare free_sized and free_aligned_sized in stdlib.h / malloc.h (#188364) 2026-03-25 11:48:07 +01:00
stdlib.yaml [libc][stdlib] Add unsetenv (#202422) 2026-06-25 15:07:08 +01:00
string.h.def [libc] Fix missing strings symbols in string.h (#192640) 2026-04-17 13:42:22 +01:00
string.yaml [libc][NFC] Lowercase standard identifiers in YAML files (#198854) 2026-05-21 06:48:03 +01:00
strings.yaml [libc] Remove trivial .h.def files (#149466) 2025-07-18 11:35:09 -07:00
syscall.h [libc] Add a redirecting <syscall.h> header. (#191069) 2026-04-09 09:36:50 -07:00
sysexits.yaml [libc] Remove yet another batch of header template files (#191067) 2026-04-08 15:56:41 -07:00
termios.yaml [libc][NFC] Lowercase standard identifiers in YAML files (#198854) 2026-05-21 06:48:03 +01:00
threads.yaml [libc] C11 threads: Add cnd_timedwait and mtx_trylock. (#195966) 2026-05-11 10:50:33 -07:00
time.yaml [libc] Add timezone extensions to struct tm and time.h (#203381) 2026-06-11 23:08:04 +01:00
uchar.yaml [libc] Remove trivial .h.def files (#149466) 2025-07-18 11:35:09 -07:00
ucontext.yaml [libc] Add ucontext types and headers (#191789) 2026-04-14 12:52:36 +00:00
Uefi.yaml [libc][uefi] add crt1 (#132150) 2025-05-09 09:02:33 -07:00
unistd.yaml [libc] Implement _SC_ARG_MAX, _SC_OPEN_MAX, and _SC_PHYS_PAGES (#204364) 2026-06-17 20:46:17 +01:00
wchar.yaml [libc] Add a placeholder for swprintf function (#200895) 2026-06-01 23:23:02 +00:00
wctype.yaml [libc] Implement towupper and towlower entrypoints (#198659) 2026-05-28 10:21:20 -07:00