Skip to content

Commit

Permalink
uapi/linux/stddef.h: Add include guards
Browse files Browse the repository at this point in the history
Add include guard wrapper define to uapi/linux/stddef.h to prevent macro
redefinition errors when stddef.h is included more than once. This was not
needed before since the only contents already used a redefinition test.

Signed-off-by: Tadeusz Struk <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Fixes: 50d7bd3 ("stddef: Introduce struct_group() helper macro")
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
  • Loading branch information
tstruk authored and kees committed Mar 31, 2022
1 parent 229a08a commit 55037ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/uapi/linux/stddef.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_STDDEF_H
#define _UAPI_LINUX_STDDEF_H

#include <linux/compiler_types.h>

#ifndef __always_inline
Expand Down Expand Up @@ -41,3 +44,4 @@
struct { } __empty_ ## NAME; \
TYPE NAME[]; \
}
#endif

0 comments on commit 55037ed

Please sign in to comment.