From 384cba431a4545906de01544bee0c655d957912d Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 8 Jun 2006 12:17:38 +0000 Subject: 2006-06-08 Marcus Brinkmann * asschk.c (__func__) [__STDC_VERSION__ < 199901L && __GNUC__ >= 2]: Define macro to __FUNCTION__. (die): Use __func__ instead of __FUNCTION__. --- tests/ChangeLog | 6 ++++++ tests/asschk.c | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index f75387757..f12d9afbe 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2006-06-08 Marcus Brinkmann + + * asschk.c (__func__) [__STDC_VERSION__ < 199901L && __GNUC__ >= 2]: + Define macro to __FUNCTION__. + (die): Use __func__ instead of __FUNCTION__. + 2005-10-07 Marcus Brinkmann * Makefile.am (TESTS_ENVIRONMENT): Remove LD_LIBRARY_PATH hack. diff --git a/tests/asschk.c b/tests/asschk.c index 59c0d107a..6a05fe1a8 100644 --- a/tests/asschk.c +++ b/tests/asschk.c @@ -116,6 +116,18 @@ # define ATTR_PRINTF(f,a) #endif +#if __STDC_VERSION__ < 199901L +# if __GNUC__ >= 2 +# define __func__ __FUNCTION__ +# else +/* Let's try our luck here. Some systems may provide __func__ without + providing __STDC_VERSION__ 199901L. */ +# if 0 +# define __func__ "" +# endif +# endif +#endif + #define spacep(p) (*(p) == ' ' || *(p) == '\t') #define MAX_LINELEN 2048 @@ -188,7 +200,7 @@ die (const char *format, ...) exit (1); } -#define die(format, args...) (die) ("%s: " format, __FUNCTION__ , ##args) +#define die(format, args...) (die) ("%s: " format, __func__ , ##args) static void err (const char *format, ...) -- cgit v1.2.3