summaryrefslogtreecommitdiff
path: root/legacy/eina/m4/efl_attribute.m4
diff options
context:
space:
mode:
Diffstat (limited to 'legacy/eina/m4/efl_attribute.m4')
-rw-r--r--legacy/eina/m4/efl_attribute.m454
1 files changed, 54 insertions, 0 deletions
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