Skip to content
This repository was archived by the owner on Nov 15, 2025. It is now read-only.

Commit 1070d27

Browse files
keszybzmartinpitt
authored andcommitted
headers: check that __INCLUDE_LEVEL__ is defined before using it (systemd#5575)
That macro is a gcc extension, and while widely supported, not ubiquitous. In particular the coverity scanner is having trouble with it.
1 parent 962a189 commit 1070d27

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/systemd/_sd-common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
/* This is a private header; never even think of including this directly! */
2424

25-
#if __INCLUDE_LEVEL__ <= 1
26-
#error "Do not include _sd-common.h directly; it is a private header."
25+
#if defined(__INCLUDE_LEVEL__) && __INCLUDE_LEVEL__ <= 1
26+
# error "Do not include _sd-common.h directly; it is a private header."
2727
#endif
2828

2929
#ifndef _sd_printf_

0 commit comments

Comments
 (0)