From 8522b4b6ddceb0486653316b1cc5ee10b084b91e Mon Sep 17 00:00:00 2001 From: Will Estes Date: Mon, 9 Sep 2002 15:52:11 +0000 Subject: [PATCH] test for presence of __func__ and compensate if absent --- configure.in | 1 + flexdef.h | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/configure.in b/configure.in index 24a12ed..352f61a 100644 --- a/configure.in +++ b/configure.in @@ -33,6 +33,7 @@ AC_TYPE_SIZE_T AC_HEADER_STDC AC_CHECK_HEADERS(string.h malloc.h sys/types.h unistd.h stdbool.h) AC_CHECK_HEADERS(cunistd netinet/in.h) +AC_CHECK_DECLS(__func__) AC_PROG_YACC AM_PROG_LEX diff --git a/flexdef.h b/flexdef.h index db0024c..c3f35e4 100644 --- a/flexdef.h +++ b/flexdef.h @@ -915,6 +915,7 @@ extern void flexerror PROTO ((const char *)); extern void flexfatal PROTO ((const char *)); /* Report a fatal error with a pinpoint, and terminate */ +#if HAVE_DECL___FUNC__ #define flex_die(msg) \ do{ \ fprintf (stderr,\ @@ -923,6 +924,16 @@ extern void flexfatal PROTO ((const char *)); __func__,msg);\ FLEX_EXIT(1);\ }while(0) +#else /* ! HAVE_DECL___FUNC__ */ +#define flex_die(msg) \ + do{ \ + fprintf (stderr,\ + _("%s: fatal internal error at %s:%d %s\n"),\ + program_name, __FILE__, (int)__LINE__,\ + msg);\ + FLEX_EXIT(1);\ + }while(0) +#endif /* ! HAVE_DECL___func__ */ /* Convert a hexadecimal digit string to an integer value. */ extern int htoi PROTO ((Char[])); -- 2.40.0