[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1297893351-2900-2-git-send-email-mkl@pengutronix.de>
Date: Wed, 16 Feb 2011 22:55:50 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: kernel@...gutronix.de
Cc: Greg Kroah-Hartman <gregkh@...e.de>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org,
Marc Kleine-Budde <mkl@...gutronix.de>
Subject: [PATCH 1/2] kernel.h: introduce BUILD_BUG_ON_NOT_SAME_TYPE
This patch introduces BUILD_BUG_ON_NOT_SAME_TYPE which forces a compilation
error if the two supplied variables don't have the same type.
Signed-off-by: Marc Kleine-Budde <mkl@...gutronix.de>
---
include/linux/kernel.h | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2fe6e84..b637d57 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -612,6 +612,8 @@ extern int __build_bug_on_failed;
} while(0)
#endif
+#define BUILD_BUG_ON_NOT_SAME_TYPE(a, b) BUILD_BUG_ON(!__same_type((a), (b)));
+
/* Trap pasters of __FUNCTION__ at compile-time */
#define __FUNCTION__ (__func__)
--
1.7.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists