1 dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
2 dnl That code is public domain and can be freely used or copied.
4 dnl Macros for checking if the compiler supports some __attribute__ uses
6 dnl Usage: EFL_ATTRIBUTE_UNUSED
7 dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available
9 AC_DEFUN([EFL_ATTRIBUTE_UNUSED],
11 AC_MSG_CHECKING([for __attribute__ ((unused))])
15 void foo(int x __attribute__ ((unused))) {}
19 [have_attribute_unused="yes"],
20 [have_attribute_unused="no"])
21 AC_MSG_RESULT([${have_attribute_unused}])
23 if test "x${have_attribute_unused}" = "xyes" ; then
24 AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.])
26 AC_DEFINE([__UNUSED__], [], [__attribute__ ((unused)) is not supported.])
30 dnl Usage: EFL_ATTRIBUTE_VECTOR
31 dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available
33 AC_DEFUN([EFL_ATTRIBUTE_VECTOR],
35 AC_MSG_CHECKING([for __attribute__ ((vector))])
39 typedef int v4si __attribute__ ((vector_size (16)));
42 if (sizeof(v4si) == 16)
47 [have_attribute_vector="yes"],
48 [have_attribute_vector="no"])
49 AC_MSG_RESULT([${have_attribute_vector}])
51 if test "x${have_attribute_vector}" = "xyes" ; then
52 AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).])
56 dnl End of efl_attribute.m4