Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: syssrc/sys/dev/cardbus
> I think your change is functionally just fine. However, for clarity
> and consistency with the leading comment I'd suggest rearranging the
> logic a bit, like
>
> #if !C99
> #if GCC2.6
> #elif GCC2.4
> #else
> #endif
> #endif /* !C99 */
>
> This should make it clear that a C99 feature is to be provided.
Ok, I'll commit following version.
btw, the test:
defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
is borrowed from assert.h but I noticed that the other part of cdefs.h
uses just this test:
__STDC_VERSION__ >= 199901L
I guess latter fails on a compiler which doesn't define
__STDC_VERSION__ at all.
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/23 00:51:03
@@ -181,6 +181,20 @@
#endif
#endif
+/*
+ * C99 defines __func__ predefined identifier, which was made available
+ * in GCC 2.95.
+ */
+#if !(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
+#if __GNUC_PREREQ__(2, 6)
+#define __func__ __PRETTY_FUNCTION__
+#elif __GNUC_PREREQ__(2, 4)
+#define __func__ __FUNCTION__
+#else
+#define __func__ ""
+#endif
+#endif /* !(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) */
+
#if defined(_KERNEL)
#if defined(NO_KERNEL_RCSIDS)
#undef __KERNEL_RCSID
Home |
Main Index |
Thread Index |
Old Index