1# Check if __attribute__((unused)) is supported 2# Stolen from dune-common (thanks) 3 4AC_DEFUN([ALBERTA_CHECK_UNUSED],[ 5 AC_CACHE_CHECK([for __attribute__((unused))], dune_cv_attribute_unused, [ 6 AC_LANG_PUSH([C++]) 7 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ 8 #define UNUSED __attribute__((unused)) 9 void f(int a UNUSED, int UNUSED) 10 { 11 int UNUSED b; 12 } 13 ]], 14 [])], 15 dune_cv_attribute_unused="yes", 16 dune_cv_attribute_unused="no") 17 AC_LANG_POP([C++]) 18 ]) 19 20 AS_IF([test "x$dune_cv_attribute_unused" = "xyes"], 21 [AC_DEFINE_UNQUOTED(HAS_ATTRIBUTE_UNUSED, 22 1, 23 [does the compiler support __attribute__((unused))?])],) 24]) 25