]> granicus.if.org Git - flex/commitdiff
test for presence of __func__ and compensate if absent
authorWill Estes <wlestes@users.sourceforge.net>
Mon, 9 Sep 2002 15:52:11 +0000 (15:52 +0000)
committerWill Estes <wlestes@users.sourceforge.net>
Mon, 9 Sep 2002 15:52:11 +0000 (15:52 +0000)
configure.in
flexdef.h

index 24a12edb226dc8f1dfe4bd5f6e70ec018aef492f..352f61af7390de7909fefdbb10858fac3bb24696 100644 (file)
@@ -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
index db0024c6d60a3efedecaa9e6e8d8a5e8045229e9..c3f35e45b0daa225216342e9e11288b95e6bbc86 100644 (file)
--- 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[]));