File: attribute.m4

package info (click to toggle)
tinc 1.0.36-2.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,284 kB
  • sloc: ansic: 13,148; sh: 4,378; makefile: 130
file content (25 lines) | stat: -rw-r--r-- 663 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 (void *)0; }
	],
       )],
       [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
])