Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 May 2020 12:42:56 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r361449 - head/sys/compat/linuxkpi/common/include/linux
Message-ID:  <202005251242.04PCguLP040634@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005251242.04PCguLP040634>