Skip to content
Snippets Groups Projects
Commit e629454b authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[m4] Replace deprecated AC_TRY_COMPILE by AC_COMPILE_IFELSE.

(reviewed by bernd)


git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@10382 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent e8b6aa4d
No related branches found
No related tags found
No related merge requests found
......@@ -3,13 +3,17 @@ AC_DEFUN([CONSTEXPR_CHECK],[
AC_REQUIRE([GXX0X])
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([whether constexpr is supported])
AC_TRY_COMPILE([],[constexpr int peng = 123;], [
HAVE_CONSTEXPR=yes
AC_MSG_RESULT(yes)], [
HAVE_CONSTEXPR=no
AC_MSG_RESULT(no)])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[],
[[constexpr int peng = 123;]])
],
[HAVE_CONSTEXPR=yes
AC_MSG_RESULT(yes)],
[HAVE_CONSTEXPR=no
AC_MSG_RESULT(no)])
AC_LANG_POP([C++])
if test "x$HAVE_CONSTEXPR" = xyes; then
AC_DEFINE(HAVE_CONSTEXPR, 1, [Define to 1 if constexpr is supported])
fi
AC_LANG_POP
])
......@@ -3,11 +3,15 @@
AC_DEFUN([DUMUX_CHECK_ALWAYS_INLINE],[
AC_MSG_CHECKING([for __attribute__((always_inline))])
AC_LANG_PUSH([C++])
AC_TRY_COMPILE([void fn() __attribute__((always_inline)); void fn() {} ],[],
[DUMUX_ALWAYS_INLINE="__attribute__((always_inline))"
AC_MSG_RESULT(yes)],
[DUMUX_ALWAYS_INLINE=""
AC_MSG_RESULT(no)])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[void fn() __attribute__((always_inline)); void fn() {} ]],
[]
)],
[DUMUX_ALWAYS_INLINE="__attribute__((always_inline))"
AC_MSG_RESULT(yes)],
[DUMUX_ALWAYS_INLINE=""
AC_MSG_RESULT(no)])
AC_LANG_POP([C++])
AC_DEFINE_UNQUOTED(DUMUX_ALWAYS_INLINE, $DUMUX_ALWAYS_INLINE,
[USE WITH CARE: Forces a function to be inlined even for non-optimized builds])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment