dumux_always_inline.m4 737 Bytes
Newer Older
1
2
3
4
5
# Check whether the function attibute 'always_inline' is available and sets
# the DUMUX_ALWAYS_INLINE macro accordingly
AC_DEFUN([DUMUX_CHECK_ALWAYS_INLINE],[
  AC_MSG_CHECKING([for __attribute__((always_inline))])
  AC_LANG_PUSH([C++])
6
7
8
9
10
11
12
13
14
  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)])
15
16
  AC_LANG_POP([C++])
  AC_DEFINE_UNQUOTED(DUMUX_ALWAYS_INLINE, $DUMUX_ALWAYS_INLINE,
17
                     [DEPRECATED: will be removed after DuMuX 2.4. USE WITH CARE: Forces a function to be inlined even for non-optimized builds])
18
])