Subject: Re: CVS commit: syssrc/sys/dev/cardbus
To: Klaus Klein <kleink@reziprozitaet.de>
From: enami tsugutomo <enami@but-b.or.jp>
List: source-changes
Date: 11/23/2001 08:58:19
> > It is still wrong. __FUNCTION__ is special to gcc! You have to name
> > the thing something else.
> 
> In that case, you might want to consider putting something like the
> __assert_function__ definition from <assert.h> into <sys/cdefs.h>
> under an appropriate name, and update KNF accordingly.

Do you mean we should invent some new symbol like __nb_function__ and
encourage developer to use it (instead of a change like below)?

enami.
Index: cdefs.h
===================================================================
RCS file: /cvsroot/syssrc/sys/sys/cdefs.h,v
retrieving revision 1.41
diff -u -r1.41 cdefs.h
--- cdefs.h	2001/05/06 14:04:58	1.41
+++ cdefs.h	2001/11/22 23:49:45
@@ -181,6 +181,19 @@
 #endif
 #endif
 
+/*
+ * C99 defines __func__ predefined identifier.
+ */
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+/* In GCC, __func__ is introduced in version 2.95. */
+#elif __GNUC_PREREQ__(2, 6)
+#define	__func__	__PRETTY_FUNCTION__
+#elif __GNUC_PREREQ__(2, 4)
+#define	__func__	__FUNCTION__
+#else
+#define	__func__	""
+#endif
+
 #if defined(_KERNEL)
 #if defined(NO_KERNEL_RCSIDS)
 #undef __KERNEL_RCSID