]> git.ipfire.org Git - thirdparty/systemd.git/commit
Introduce forward.h header with forward declarations
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 13 May 2025 09:50:05 +0000 (11:50 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 14 May 2025 13:44:17 +0000 (15:44 +0200)
commit686bbf1e7ff7492a86f48d4b9877c2cfb5deca53
tree3eb44309e8d21a161a5e6f5a16f943d9f45f50fa
parentd6319768bdf53b38d6256a17956f7538eb844f61
Introduce forward.h header with forward declarations

In preparation for adopting forward declarations to reduce unnecessary
transitive includes across the tree, let's introduce a forward.h header
with forward declarations for all libc, libsystemd, basic and shared types.

Additionally, this header exports all basic integer types and errno constants,
as well as all macros including assertions macros. These header files contain
types often used in headers and are always included in every source file one
way or another anyway.

To avoid having to include memory-util.h and alloc-util.h in forward.h, we
split off the parts we need from both into cleanup-util.h and only include
cleanup-util.h in forward.h.

To keep this commit self-contained, we include cleanup-fundamental.h and
cleanup-util.h from the headers that originally contained the same macros.
We'll remove these again in a later commit that optimizes the includes in
src/basic and src/fundamental.

Split out of #37364
docs/CODING_STYLE.md
src/basic/alloc-util.h
src/basic/cleanup-util.h [new file with mode: 0644]
src/basic/forward.h [new file with mode: 0644]
src/basic/memory-util.h
src/fundamental/cleanup-fundamental.h [new file with mode: 0644]
src/fundamental/macro-fundamental.h
src/fundamental/memory-util-fundamental.h