Subject: Re: CVS commit: syssrc/sys/dev/cardbus
To: enami tsugutomo <enami@but-b.or.jp>
From: Perry E. Metzger <perry@wasabisystems.com>
List: source-changes
Date: 11/22/2001 19:15:06
enami tsugutomo <enami@but-b.or.jp> writes:
> Do you mean we should invent some new symbol like __nb_function__ and
> encourage developer to use it (instead of a change like below)?

I like the way you've done this. It seems very good.

I'm not sure it should be __PRETTY_FUNCTION__ instead of __FUNCTION__
The documentation seems to say __PRETTY_FUNCTION__ is  only for c++....

> 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
> 

--
Perry E. Metzger		perry@wasabisystems.com
--
NetBSD Development, Support & CDs. http://www.wasabisystems.com/