opnsense-src/sys/compat/linuxkpi/common/include/linux/stddef.h
Bjoern A. Zeeb 6e214c2140 LinuxKPI: add struct_group_tagged()
Restructure struct_group() into a wrapper around __struct_group().
Various callers have arguments annotated as /* no foo */ so try to
add all we can find.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	dumbbell
Differential Revision: https://reviews.freebsd.org/D50157

(cherry picked from commit 54d0e1772fb6b83d72725764e0a5d3ead8337673)
2025-07-16 08:45:06 +02:00

31 lines
795 B
C

/* Public domain */
#ifndef _LINUXKPI_LINUX_STDDEF_H_
#define _LINUXKPI_LINUX_STDDEF_H_
#include <sys/stddef.h>
/*
* FreeBSD has multiple (vendor) drivers containing copies of this
* and including LinuxKPI headers. Put the #defines behind guards.
*/
#ifndef __struct_group
#define __struct_group(_tag, _name, _attrs, _members...) \
union { \
struct { _members } _attrs; \
struct _tag { _members } _attrs _name; \
} _attrs
#endif
#ifndef struct_group
#define struct_group(_name, _members...) \
__struct_group(/* no tag */, _name, /* no attrs */, _members)
#endif
#ifndef struct_group_tagged
#define struct_group_tagged(_tag, _name, _members...) \
__struct_group(_tag, _name, /* no attrs */, _members)
#endif
#endif /* _LINUXKPI_LINUX_STDDEF_H_ */