Provide compat definition of __func__ for pre-C99 compiler.

This commit is contained in:
enami 2001-11-23 10:19:47 +00:00
parent 8c1a59d37e
commit 4789a8840d
1 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cdefs.h,v 1.41 2001/05/06 14:04:58 kleink Exp $ */
/* $NetBSD: cdefs.h,v 1.42 2001/11/23 10:19:47 enami Exp $ */
/*
* Copyright (c) 1991, 1993
@ -181,6 +181,20 @@
#endif
#endif
/*
* C99 defines __func__ predefined identifier, which was made available
* in GCC 2.95.
*/
#if !(__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 /* !(__STDC_VERSION__ >= 199901L) */
#if defined(_KERNEL)
#if defined(NO_KERNEL_RCSIDS)
#undef __KERNEL_RCSID