From 86ce0f6be9f0a9c5219663074525fcd976ac3aef Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Thu, 29 Sep 2011 06:07:40 +0000 Subject: [PATCH] use another m4 macro for __atribute__ SVN revision: 63651 --- legacy/eina/configure.ac | 2 +- legacy/eina/m4/ac_attribute.m4 | 47 -------------------------- legacy/eina/m4/efl_attribute.m4 | 54 ++++++++++++++++++++++++++++++ legacy/eina/src/lib/eina_private.h | 6 ---- 4 files changed, 55 insertions(+), 54 deletions(-) delete mode 100644 legacy/eina/m4/ac_attribute.m4 create mode 100644 legacy/eina/m4/efl_attribute.m4 diff --git a/legacy/eina/configure.ac b/legacy/eina/configure.ac index e2c997d2d8..f00f44dccc 100644 --- a/legacy/eina/configure.ac +++ b/legacy/eina/configure.ac @@ -391,8 +391,8 @@ AC_CHECK_TYPES([siginfo_t], [], [], AC_C_CONST AC_C_BIGENDIAN AC_C_INLINE -AC_C___ATTRIBUTE__ AC_PROG_CC_STDC +EFL_ATTRIBUTE_UNUSED have_wince="no" have_win32="no" diff --git a/legacy/eina/m4/ac_attribute.m4 b/legacy/eina/m4/ac_attribute.m4 deleted file mode 100644 index 23479a92ac..0000000000 --- a/legacy/eina/m4/ac_attribute.m4 +++ /dev/null @@ -1,47 +0,0 @@ -dnl Copyright (C) 2004-2008 Kim Woelders -dnl Copyright (C) 2008 Vincent Torri -dnl That code is public domain and can be freely used or copied. -dnl Originally snatched from somewhere... - -dnl Macro for checking if the compiler supports __attribute__ - -dnl Usage: AC_C___ATTRIBUTE__ -dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__ -dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is -dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused)) -dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is -dnl defined to nothing. - -AC_DEFUN([AC_C___ATTRIBUTE__], -[ - -AC_MSG_CHECKING([for __attribute__]) - -AC_CACHE_VAL([ac_cv___attribute__], - [AC_TRY_COMPILE( - [ -#include - -int func(int x); -int foo(int x __attribute__ ((unused))) -{ - exit(1); -} - ], - [], - [ac_cv___attribute__="yes"], - [ac_cv___attribute__="no"] - )]) - -AC_MSG_RESULT($ac_cv___attribute__) - -if test "x${ac_cv___attribute__}" = "xyes" ; then - AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__]) - AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused]) - else - AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused]) -fi - -]) - -dnl End of ac_attribute.m4 diff --git a/legacy/eina/m4/efl_attribute.m4 b/legacy/eina/m4/efl_attribute.m4 new file mode 100644 index 0000000000..d03db5394e --- /dev/null +++ b/legacy/eina/m4/efl_attribute.m4 @@ -0,0 +1,54 @@ +dnl Copyright (C) 2011 Vincent Torri +dnl That code is public domain and can be freely used or copied. + +dnl Macros for checking if the compiler supports some __attribute__ uses + +dnl Usage: EFL_ATTRIBUTE_UNUSED +dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available + +AC_DEFUN([EFL_ATTRIBUTE_UNUSED], +[ +AC_MSG_CHECKING([for __attribute__ ((unused))]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ + ]], + [[ +void foo(int x __attribute__ ((unused))) {} + ]])], + [have_attribute_unused="yes"], + [have_attribute_unused="no"]) +AC_MSG_RESULT([${have_attribute_unused}]) + +if test "x${have_attribute_unused}" = "xyes" ; then + AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.]) +fi +]) + +dnl Usage: EFL_ATTRIBUTE_VECTOR +dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available + +AC_DEFUN([EFL_ATTRIBUTE_VECTOR], +[ +AC_MSG_CHECKING([for __attribute__ ((vector))]) +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +typedef int v4si __attribute__ ((vector_size (16))); + ]], + [[ +if (sizeof(v4si) == 16) + return 0; +else + return -1; + ]])], + [have_attribute_vector="yes"], + [have_attribute_vector="no"]) +AC_MSG_RESULT([${have_attribute_vector}]) + +if test "x${have_attribute_vector}" = "xyes" ; then + AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).]) +fi +]) + +dnl End of efl_attribute.m4 diff --git a/legacy/eina/src/lib/eina_private.h b/legacy/eina/src/lib/eina_private.h index 78a1b7d090..d3903972a2 100644 --- a/legacy/eina/src/lib/eina_private.h +++ b/legacy/eina/src/lib/eina_private.h @@ -21,12 +21,6 @@ #include -#if HAVE___ATTRIBUTE__ -# define __UNUSED__ __attribute__((unused)) -#else -# define __UNUSED__ -#endif - #include "eina_magic.h" #include "eina_iterator.h" #include "eina_accessor.h"