svn commit: r361449 - head/sys/compat/linuxkpi/common/include/linux
Emmanuel Vadot
manu at FreeBSD.org
Mon May 25 12:42:56 UTC 2020
Author: manu
Date: Mon May 25 12:42:55 2020
New Revision: 361449
URL: https://svnweb.freebsd.org/changeset/base/361449
Log:
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
Modified:
head/sys/compat/linuxkpi/common/include/linux/compiler.h
Modified: head/sys/compat/linuxkpi/common/include/linux/compiler.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/compiler.h Mon May 25 12:41:44 2020 (r361448)
+++ head/sys/compat/linuxkpi/common/include/linux/compiler.h Mon May 25 12:42:55 2020 (r361449)
@@ -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_ */
More information about the svn-src-head
mailing list