summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2011-09-29 06:07:40 +0000
committerVincent Torri <vincent.torri@gmail.com>2011-09-29 06:07:40 +0000
commit86ce0f6be9f0a9c5219663074525fcd976ac3aef (patch)
tree70d0d221269add02a4e9e6bbdc0e73abc157d33e /legacy
parentdb4c82bc462a1f5bc67d2cce93a98da48f2b52f2 (diff)
use another m4 macro for __atribute__
SVN revision: 63651
Diffstat (limited to 'legacy')
-rw-r--r--legacy/eina/configure.ac2
-rw-r--r--legacy/eina/m4/ac_attribute.m447
-rw-r--r--legacy/eina/m4/efl_attribute.m454
-rw-r--r--legacy/eina/src/lib/eina_private.h6
4 files changed, 55 insertions, 54 deletions
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], [], [],
391AC_C_CONST 391AC_C_CONST
392AC_C_BIGENDIAN 392AC_C_BIGENDIAN
393AC_C_INLINE 393AC_C_INLINE
394AC_C___ATTRIBUTE__
395AC_PROG_CC_STDC 394AC_PROG_CC_STDC
395EFL_ATTRIBUTE_UNUSED
396 396
397have_wince="no" 397have_wince="no"
398have_win32="no" 398have_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 @@
1dnl Copyright (C) 2004-2008 Kim Woelders
2dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
3dnl That code is public domain and can be freely used or copied.
4dnl Originally snatched from somewhere...
5
6dnl Macro for checking if the compiler supports __attribute__
7
8dnl Usage: AC_C___ATTRIBUTE__
9dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
10dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
11dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
12dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
13dnl defined to nothing.
14
15AC_DEFUN([AC_C___ATTRIBUTE__],
16[
17
18AC_MSG_CHECKING([for __attribute__])
19
20AC_CACHE_VAL([ac_cv___attribute__],
21 [AC_TRY_COMPILE(
22 [
23#include <stdlib.h>
24
25int func(int x);
26int foo(int x __attribute__ ((unused)))
27{
28 exit(1);
29}
30 ],
31 [],
32 [ac_cv___attribute__="yes"],
33 [ac_cv___attribute__="no"]
34 )])
35
36AC_MSG_RESULT($ac_cv___attribute__)
37
38if test "x${ac_cv___attribute__}" = "xyes" ; then
39 AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
40 AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
41 else
42 AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
43fi
44
45])
46
47dnl 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 @@
1dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macros for checking if the compiler supports some __attribute__ uses
5
6dnl Usage: EFL_ATTRIBUTE_UNUSED
7dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available
8
9AC_DEFUN([EFL_ATTRIBUTE_UNUSED],
10[
11AC_MSG_CHECKING([for __attribute__ ((unused))])
12AC_COMPILE_IFELSE(
13 [AC_LANG_PROGRAM(
14 [[
15 ]],
16 [[
17void foo(int x __attribute__ ((unused))) {}
18 ]])],
19 [have_attribute_unused="yes"],
20 [have_attribute_unused="no"])
21AC_MSG_RESULT([${have_attribute_unused}])
22
23if test "x${have_attribute_unused}" = "xyes" ; then
24 AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.])
25fi
26])
27
28dnl Usage: EFL_ATTRIBUTE_VECTOR
29dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available
30
31AC_DEFUN([EFL_ATTRIBUTE_VECTOR],
32[
33AC_MSG_CHECKING([for __attribute__ ((vector))])
34AC_COMPILE_IFELSE(
35 [AC_LANG_PROGRAM(
36 [[
37typedef int v4si __attribute__ ((vector_size (16)));
38 ]],
39 [[
40if (sizeof(v4si) == 16)
41 return 0;
42else
43 return -1;
44 ]])],
45 [have_attribute_vector="yes"],
46 [have_attribute_vector="no"])
47AC_MSG_RESULT([${have_attribute_vector}])
48
49if test "x${have_attribute_vector}" = "xyes" ; then
50 AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).])
51fi
52])
53
54dnl 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 @@
21 21
22#include <stdarg.h> 22#include <stdarg.h>
23 23
24#if HAVE___ATTRIBUTE__
25# define __UNUSED__ __attribute__((unused))
26#else
27# define __UNUSED__
28#endif
29
30#include "eina_magic.h" 24#include "eina_magic.h"
31#include "eina_iterator.h" 25#include "eina_iterator.h"
32#include "eina_accessor.h" 26#include "eina_accessor.h"