]> git.meshlink.io Git - meshlink/blob - m4/attribute.m4
Never automatically try to bind to ports >= 32768.
[meshlink] / m4 / attribute.m4
1 dnl Check to find out whether function attributes are supported.
2 dnl If they are not, #define them to be nothing.
3
4 AC_DEFUN([MeshLink_ATTRIBUTE],
5 [
6   AC_CACHE_CHECK([for working $1 attribute], MeshLink_cv_attribute_$1,
7   [ 
8     tempcflags="$CFLAGS"
9     CFLAGS="$CFLAGS -Wall -Werror"
10     AC_COMPILE_IFELSE(
11       [AC_LANG_SOURCE(
12         [void *test(void *arg) __attribute__ (($1));
13          void *test(void *arg) { return arg; }
14         ],
15        )],
16        [MeshLink_cv_attribute_$1=yes],
17        [MeshLink_cv_attribute_$1=no]
18      )
19      CFLAGS="$tempcflags"
20    ])
21
22    if test ${MeshLink_cv_attribute_$1} = no; then
23      AC_DEFINE([$1], [], [Defined if the $1 attribute is not supported.])
24    fi
25 ])