mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
check-if-compiler-supports-__FUNCTION__-macro-20040426
Add an autoconf check to see if the compiler supports __FUNCTION__ and __LINE__
This commit is contained in:
parent
a40db2ebc0
commit
519e7f0669
@ -91,6 +91,7 @@ dnl Various compiler setup.
|
|||||||
AC_TYPE_PID_T
|
AC_TYPE_PID_T
|
||||||
AC_TYPE_SIZE_T
|
AC_TYPE_SIZE_T
|
||||||
AC_TYPE_SIGNAL
|
AC_TYPE_SIGNAL
|
||||||
|
COMPILER_HAS_FUNCTION_MACRO
|
||||||
|
|
||||||
dnl Checks for programs.
|
dnl Checks for programs.
|
||||||
AC_PROG_INSTALL
|
AC_PROG_INSTALL
|
||||||
|
15
src/cf/function-macro.m4
Normal file
15
src/cf/function-macro.m4
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
AC_DEFUN(COMPILER_HAS_FUNCTION_MACRO, [
|
||||||
|
AC_MSG_CHECKING(for __FUNCTION__ and __LINE__ macros)
|
||||||
|
AC_CACHE_VAL(ac_cv_compiler_has_function_macro,
|
||||||
|
[
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[#include <stdio.h>],
|
||||||
|
[printf("%s:%d", __FUNCTION__, __LINE__);],
|
||||||
|
ac_cv_compiler_has_function_macro=yes,
|
||||||
|
ac_cv_compiler_has_function_macro=no)])
|
||||||
|
AC_MSG_RESULT($ac_cv_compiler_has_function_macro)
|
||||||
|
if test "$ac_cv_compiler_has_function_macro" = "yes"; then
|
||||||
|
AC_DEFINE(HAVE_FUNCTION_MACRO, 1, [define if compiler has __FUNCTION__])
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user