summaryrefslogtreecommitdiff
path: root/m4/efl_attribute.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/efl_attribute.m4')
-rw-r--r--m4/efl_attribute.m483
1 files changed, 0 insertions, 83 deletions
diff --git a/m4/efl_attribute.m4 b/m4/efl_attribute.m4
deleted file mode 100644
index 4f31d93..0000000
--- a/m4/efl_attribute.m4
+++ /dev/null
@@ -1,83 +0,0 @@
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_VECTOR
7dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available
8
9AC_DEFUN([EFL_ATTRIBUTE_VECTOR],
10[
11AC_MSG_CHECKING([for __attribute__ ((vector))])
12AC_COMPILE_IFELSE(
13 [AC_LANG_PROGRAM(
14 [[
15typedef int v4si __attribute__ ((vector_size (16)));
16 ]],
17 [[
18if (sizeof(v4si) == 16)
19 return 0;
20else
21 return -1;
22 ]])],
23 [have_attribute_vector="yes"],
24 [have_attribute_vector="no"])
25AC_MSG_RESULT([${have_attribute_vector}])
26
27if test "x${have_attribute_vector}" = "xyes" ; then
28 AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).])
29fi
30])
31
32dnl Usage: EFL_ATTRIBUTE_ALWAYS_INLINE
33dnl call AC_DEFINE for alway_inline if __attribute__((always_inline)) is available
34
35AC_DEFUN([EFL_ATTRIBUTE_ALWAYS_INLINE],
36[
37
38have_attribute_forceinline="no"
39
40AC_MSG_CHECKING([for __forceinline])
41
42AC_COMPILE_IFELSE(
43 [AC_LANG_PROGRAM(
44 [[
45#include <windows.h>
46static __forceinline void foo(void) {}
47 ]],
48 [[
49 ]])],
50 [
51 have_attribute_always_inline="yes"
52 have_attribute_forceinline="yes"
53 ],
54 [have_attribute_always_inline="no"])
55
56AC_MSG_RESULT([${have_attribute_always_inline}])
57
58if test "x${have_attribute_always_inline}" = "xno" ; then
59 AC_MSG_CHECKING([for __attribute__ ((__always_inline__))])
60 AC_COMPILE_IFELSE(
61 [AC_LANG_PROGRAM(
62 [[
63static __attribute__((__always_inline__)) inline void foo(void) {}
64 ]],
65 [[
66 ]])],
67 [have_attribute_always_inline="yes"],
68 [have_attribute_always_inline="no"])
69 AC_MSG_RESULT([${have_attribute_always_inline}])
70fi
71
72if test "x${have_attribute_always_inline}" = "xyes" ; then
73 if test "x${have_attribute_forceinline}" = "xyes" ; then
74 AC_DEFINE([EFL_ALWAYS_INLINE], [__forceinline], [Macro declaring a function to always be inlined.])
75 else
76 AC_DEFINE([EFL_ALWAYS_INLINE], [__attribute__ ((__always_inline__)) inline], [Macro declaring a function to always be inlined.])
77 fi
78else
79 AC_DEFINE([EFL_ALWAYS_INLINE], [static inline], [Macro declaring a function to always be inlined.])
80fi
81])
82
83dnl End of efl_attribute.m4