mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 13:58:30 -04:00
linuxkpi: Add __same_type and __must_be_array macros
The same_type macro simply wraps around builtin_types_compatible_p which exist for both GCC and CLANG, which returns 1 if both types are the same. The __must_be_array macros returns 1 if the argument is an array. This is needed for DRM v5.3 Sponsored-by: The FreeBSD Foundation Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D24953
This commit is contained in:
parent
5a90435ccf
commit
93d70cd3fe
1 changed files with 3 additions and 0 deletions
|
|
@ -111,4 +111,7 @@
|
|||
|
||||
#define _AT(T,X) ((T)(X))
|
||||
|
||||
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
|
||||
#define __must_be_array(a) __same_type(a, &(a)[0])
|
||||
|
||||
#endif /* _LINUX_COMPILER_H_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue