]> err.no Git - linux-2.6/blobdiff - include/linux/kernel.h
[PATCH] mutex subsystem, add typecheck_fn(type, function)
[linux-2.6] / include / linux / kernel.h
index b1e407a4fbda1ec9b101c5e0bd2c3c4378b7bb5b..d0e6ca3b00ef0510b13b308640ba8b1eff2efcce 100644 (file)
@@ -286,6 +286,15 @@ extern void dump_stack(void);
        1; \
 })
 
+/*
+ * Check at compile time that 'function' is a certain type, or is a pointer
+ * to that type (needs to use typedef for the function type.)
+ */
+#define typecheck_fn(type,function) \
+({     typeof(type) __tmp = function; \
+       (void)__tmp; \
+})
+
 #endif /* __KERNEL__ */
 
 #define SI_LOAD_SHIFT  16
@@ -316,8 +325,6 @@ extern int randomize_va_space;
 #endif
 
 /* Trap pasters of __FUNCTION__ at compile-time */
-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 95
 #define __FUNCTION__ (__func__)
-#endif
 
 #endif