summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-04-26 14:20:46 +0000
committerStefan Metzmacher <metze@samba.org>2006-04-26 14:20:46 +0000
commitd87ed5ad95ff7fc6ba719c8c1378a92d17cad7f7 (patch)
tree290fa1f6405305e30da9689a9137a914ea4b28cc
parent8272034f6a28706b467ea7cd028375ff6db0953e (diff)
downloadsamba-d87ed5ad95ff7fc6ba719c8c1378a92d17cad7f7.tar.gz
samba-d87ed5ad95ff7fc6ba719c8c1378a92d17cad7f7.tar.xz
samba-d87ed5ad95ff7fc6ba719c8c1378a92d17cad7f7.zip
r15280: - remove the 2nd check for __FUNCTION__
- fallback to __func__ if __FUNCTION__ isn't there metze
-rw-r--r--source/build/m4/check_cc.m47
-rw-r--r--source/lib/replace/config.m48
-rw-r--r--source/lib/replace/replace.h4
3 files changed, 12 insertions, 7 deletions
diff --git a/source/build/m4/check_cc.m4 b/source/build/m4/check_cc.m4
index 64f44cd6ff7..f5b6fa09950 100644
--- a/source/build/m4/check_cc.m4
+++ b/source/build/m4/check_cc.m4
@@ -187,13 +187,6 @@ AC_SUBST(HOSTCC)
AC_PATH_PROG(GCOV,gcov)
-AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
-AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
-samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
-if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
- AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
-fi
-
AC_PATH_PROG(MAKE,make)
AC_CACHE_CHECK([whether we have GNU make], samba_cv_gnu_make, [
diff --git a/source/lib/replace/config.m4 b/source/lib/replace/config.m4
index bac38f6439e..bf46bdcc58d 100644
--- a/source/lib/replace/config.m4
+++ b/source/lib/replace/config.m4
@@ -167,6 +167,14 @@ AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
+else
+ dnl __func__ macro
+ AC_CACHE_CHECK([for __func__ macro],samba_cv_HAVE_func_MACRO,[
+ AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __func__);],
+ samba_cv_HAVE_func_MACRO=yes,samba_cv_HAVE_func_MACRO=no)])
+ if test x"$samba_cv_HAVE_func_MACRO" = x"yes"; then
+ AC_DEFINE(HAVE_func_MACRO,1,[Whether there is a __func__ macro])
+ fi
fi
AC_CHECK_HEADERS([sys/param.h])
diff --git a/source/lib/replace/replace.h b/source/lib/replace/replace.h
index 77f42acc97d..d0575f4b60b 100644
--- a/source/lib/replace/replace.h
+++ b/source/lib/replace/replace.h
@@ -212,8 +212,12 @@ typedef int bool;
#endif
#ifndef HAVE_FUNCTION_MACRO
+#ifdef HAVE_func_MACRO
+#define __FUNCTION__ __func__
+#else
#define __FUNCTION__ ("")
#endif
+#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>