summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-12-29 16:03:28 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-12-29 16:03:28 +0000
commitb730378d180af2e88bd1624b4f3a7c181697d753 (patch)
treedbfd39524c0f046df7d3eaff92ddf55bf1c5f19f /m4
parent1a3f246c5dcd45ab5dcd7425332520fc34627f4d (diff)
RELEASE THE HOUNDS!... edbus missing m4 macro to detect va args list
type and that b0rxed edbus on 64bit. this fixes it. tnx to k-s for pointing at it. SVN revision: 81878
Diffstat (limited to 'm4')
-rw-r--r--m4/ac_valist.m448
1 files changed, 48 insertions, 0 deletions
diff --git a/m4/ac_valist.m4 b/m4/ac_valist.m4
new file mode 100644
index 0000000000..a4d6a24932
--- /dev/null
+++ b/m4/ac_valist.m4
@@ -0,0 +1,48 @@
1dnl That code is public domain and can be freely used or copied.
2dnl Originally snatched from somewhere...
3
4dnl Macro for checking if va_list is an array
5
6dnl Usage: AC_C_VA_LIST_AS_ARRAY
7dnl call AC_DEFINE for HAVE_VA_LIST_AS_ARRAY
8dnl if for this architecture va_list is defined as an array
9
10AC_DEFUN([AC_C_VA_LIST_AS_ARRAY],
11[
12
13AC_MSG_CHECKING([whether va_list is defined as an array])
14
15AC_CACHE_VAL([ac_cv_valistasarray],
16 [AC_TRY_RUN(
17 [
18#include <stdlib.h>
19#include <stdarg.h>
20void foo(int i, ...)
21{
22 va_list ap1, ap2;
23 va_start(ap1, i);
24 ap2 = ap1;
25 if (va_arg(ap2, int) != 123 || va_arg(ap1, int) != 123)
26 exit(1);
27 va_end(ap1);
28}
29int main(void)
30{
31 foo(0, 123);
32 return(0);
33}
34 ],
35 [ac_cv_valistasarray="no"],
36 [ac_cv_valistasarray="yes"],
37 [ac_cv_valistasarray="no"]
38 )])
39
40AC_MSG_RESULT($ac_cv_valistasarray)
41
42if test "x${ac_cv_valistasarray}" = "xyes" ; then
43 AC_DEFINE([HAVE_VA_LIST_AS_ARRAY], [1], [Define to 1 if va_list is an array])
44fi
45
46])
47
48dnl End of ac_valist.m4