summaryrefslogtreecommitdiff
path: root/m4/gcc_check_builtin.m4
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--m4/gcc_check_builtin.m420
1 files changed, 20 insertions, 0 deletions
diff --git a/m4/gcc_check_builtin.m4 b/m4/gcc_check_builtin.m4
new file mode 100644
index 0000000000..1434c5f80a
--- /dev/null
+++ b/m4/gcc_check_builtin.m4
@@ -0,0 +1,20 @@
1AC_DEFUN([EFL_CHECK_GCC_BUILTIN],
2[efl_check_gcc_builtin_save_libs=$LIBS
3LIBS="-lm $LIBS"
4AC_LINK_IFELSE(
5[AC_LANG_PROGRAM(
6[[#ifndef __GNUC__
7choke me
8#else
9#undef $1
10/* Declare this function with same prototype as __builtin_$1.
11 This removes warning about conflicting type with builtin */
12__typeof__(__builtin_$1) $1;
13
14__typeof__(__builtin_$1) *f = $1;
15#endif
16]], [[return f != $1;]]
17)],
18[AC_DEFINE([$2], [123], [GCC builtin $1 exists])])
19LIBS=$efl_check_gcc_builtin_save_libs])
20