Check if the compiler knows about the __malloc__ attribute.
This commit is contained in:
parent
d798b8b3d8
commit
da3078c63a
3 changed files with 31 additions and 3 deletions
25
m4/attribute.m4
Normal file
25
m4/attribute.m4
Normal file
|
@ -0,0 +1,25 @@
|
|||
dnl Check to find out whether function attributes are supported.
|
||||
dnl If they are not, #define them to be nothing.
|
||||
|
||||
AC_DEFUN(tinc_ATTRIBUTE,
|
||||
[
|
||||
AC_CACHE_CHECK([for working $1 attribute], tinc_cv_attribute_$1,
|
||||
[
|
||||
tempcflags="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -Wall -Werror"
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_SOURCE(
|
||||
[void test(void) __attribute__ (($1));
|
||||
void test(void) { return; }
|
||||
],
|
||||
)],
|
||||
[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
|
||||
])
|
Loading…
Add table
Add a link
Reference in a new issue