1
############################################################################
3
# SIM_AC_CHECK_VAR_FUNCTIONNAME
7
# HAVE_VAR___func__ (1 if exists)
8
# HAVE_VAR___PRETTY_FUNCTION__ (1 if exists)
9
# HAVE_VAR___FUNCTION__ (1 if exists)
11
# (Note that only one of these will be defined.)
14
# Lars J. Aas <larsa@sim.no>
15
# Morten Eriksen <mortene@sim.no>
17
AC_DEFUN([SIM_AC_CHECK_VAR_FUNCTIONNAME], [
18
AC_CACHE_CHECK([for function name variable],
19
sim_cv_var_functionname, [
20
# __func__ is the identifier used by compilers which are
21
# compliant with the C99 ISO/IEC 9899:1999 standard.
24
[(void)printf("%s\n",__func__)],
25
[sim_cv_var_functionname=__func__],
26
[sim_cv_var_functionname=none])
27
if test x"$sim_cv_var_functionname" = x"none"; then
28
# GCC uses __PRETTY_FUNCTION__
31
[(void)printf("%s\n",__PRETTY_FUNCTION__)],
32
[sim_cv_var_functionname=__PRETTY_FUNCTION__],
33
[sim_cv_var_functionname=none])
35
if test x"$sim_cv_var_functionname" = x"none"; then
38
[(void)printf("%s\n",__FUNCTION__)],
39
[sim_cv_var_functionname=__FUNCTION__],
40
[sim_cv_var_functionname=none])
43
# FIXME: these can probably be contracted to a single test inside a loop.
46
if test x"$sim_cv_var_functionname" = x"__func__"; then
47
AC_DEFINE([HAVE_VAR___func__], 1,
48
[Define this to true if the __func__ variable contains the current function name])
51
if test x"$sim_cv_var_functionname" = x"__PRETTY_FUNCTION__"; then
52
AC_DEFINE([HAVE_VAR___PRETTY_FUNCTION__], 1,
53
[Define this to true if the __PRETTY_FUNCTION__ variable contains the current function name])
56
if test x"$sim_cv_var_functionname" = x"__FUNCTION__"; then
57
AC_DEFINE([HAVE_VAR___FUNCTION__], 1,
58
[Define this to true if the __FUNCTION__ variable contains the current function name])