diff options
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..d4a7753 --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,30 @@ +dnl +dnl Test for __attribute__ ((unused)) +dnl Based on code from the tcpdump version 3.7.2 source. +dnl + +AC_DEFUN([AC_C___ATTRIBUTE__], [ +AC_MSG_CHECKING(for __attribute__) +AC_CACHE_VAL(ac_cv___attribute__, [ +AC_TRY_COMPILE([ +#include <stdlib.h> +static void foo (void) __attribute__ ((unused)); + +static void +foo (void) +{ + exit(1); +} +], +[ + exit (0); +], +ac_cv___attribute__=yes, +ac_cv___attribute__=no)]) +if test "$ac_cv___attribute__" = "yes"; then + AC_DEFINE(UNUSED, __attribute__ ((unused)), [define if your compiler has __attribute__ ((unused))]) +else + AC_DEFINE(UNUSED,,) +fi +AC_MSG_RESULT($ac_cv___attribute__) +]) |