Skip to content

Commit

Permalink
lib/defines.h: Don't wrap #undef in #ifdef
Browse files Browse the repository at this point in the history
ISO C guarantees that #undef is a no-op if there is no such macro.

C11::6.10.3.5p2:
> A preprocessing directive of the form
>
>       # undef identifier new-line
>
> causes the specified identifier no longer to be defined as a macro
> name.  It is ignored if the specified identifier is not currently
> defined as a macro name.

Link: <http://port70.net/~nsz/c/c11/n1570.html#6.10.3.5p2>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
  • Loading branch information
alejandro-colomar authored and hallyn committed Jan 15, 2024
1 parent effdb14 commit 1356b14
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,9 @@
#define SHADOW_SP_FLAG_UNSET ((unsigned long)-1)

#ifdef WITH_AUDIT
#ifdef __u8 /* in case we use pam < 0.80 */
/* in case we use pam < 0.80 */
#undef __u8
#endif
#ifdef __u32
#undef __u32
#endif

#include <libaudit.h>
#endif
Expand Down

0 comments on commit 1356b14

Please sign in to comment.