summaryrefslogtreecommitdiff
path: root/autoconf/ast_gcc_attribute.m4
diff options
context:
space:
mode:
Diffstat (limited to 'autoconf/ast_gcc_attribute.m4')
-rw-r--r--autoconf/ast_gcc_attribute.m419
1 files changed, 4 insertions, 15 deletions
diff --git a/autoconf/ast_gcc_attribute.m4 b/autoconf/ast_gcc_attribute.m4
index b1972bedf..9d5a32045 100644
--- a/autoconf/ast_gcc_attribute.m4
+++ b/autoconf/ast_gcc_attribute.m4
@@ -9,28 +9,17 @@ CFLAGS="$CFLAGS -Wall -Wno-unused -Werror"
m4_ifval([$4],$4=0)
ax_cv_have_func_attribute_$1=0
-if test "x$2" = "x"
-then
AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
- [])],
+ [AC_LANG_PROGRAM(
+ m4_ifblank([$2],
+ [$3 void __attribute__(($1)) *test(void *muffin, ...) {return (void *) 0;}],
+ [$3 void __attribute__(($2)) *test(void *muffin, ...) ;]))],
AC_MSG_RESULT(yes)
m4_ifval([$4],$4=1)
ax_cv_have_func_attribute_$1=1
AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
AC_MSG_RESULT(no)
)
-else
-AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([$3 void __attribute__(($2)) *test(void *muffin, ...) ;],
- [])],
- AC_MSG_RESULT(yes)
- m4_ifval([$4],$4=1)
- ax_cv_have_func_attribute_$1=1
- AC_DEFINE_UNQUOTED([HAVE_ATTRIBUTE_$1], 1, [Define to 1 if your GCC C compiler supports the '$1' attribute.]),
- AC_MSG_RESULT(no)
-)
-fi
m4_ifval([$4],[AC_SUBST($4)])
CFLAGS="$saved_CFLAGS"