2003-07-31 11:17:39 +00:00
|
|
|
dnl Check to find out whether function attributes are supported.
|
|
|
|
dnl If they are not, #define them to be nothing.
|
|
|
|
|
2004-01-10 23:21:36 +00:00
|
|
|
AC_DEFUN([tinc_ATTRIBUTE],
|
2003-07-31 11:17:39 +00:00
|
|
|
[
|
|
|
|
AC_CACHE_CHECK([for working $1 attribute], tinc_cv_attribute_$1,
|
|
|
|
[
|
|
|
|
tempcflags="$CFLAGS"
|
|
|
|
CFLAGS="$CFLAGS -Wall -Werror"
|
|
|
|
AC_COMPILE_IFELSE(
|
|
|
|
[AC_LANG_SOURCE(
|
2015-06-07 20:25:22 +00:00
|
|
|
[void *test(void) __attribute__ (($1));
|
|
|
|
void *test(void) { return (void *)0; }
|
2003-07-31 11:17:39 +00:00
|
|
|
],
|
|
|
|
)],
|
|
|
|
[tinc_cv_attribute_$1=yes],
|
|
|
|
[tinc_cv_attribute_$1=no]
|
|
|
|
)
|
|
|
|
CFLAGS="$tempcflags"
|
|
|
|
])
|
|
|
|
|
|
|
|
if test ${tinc_cv_attribute_$1} = no; then
|
|
|
|
AC_DEFINE([$1], [], [Defined if the $1 attribute is not supported.])
|
|
|
|
fi
|
|
|
|
])
|