diff options
-rw-r--r-- | configure.ac | 25 | ||||
-rw-r--r-- | lib/talloc/talloc.c | 13 |
2 files changed, 32 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index d9fe8ad..d123556 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,31 @@ fi AC_PROG_CC AC_PROG_INSTALL +AC_CHECK_HEADERS([stdarg.h]) +AC_CHECK_HEADERS([varargs.h]) +#AC_CHECK_FUNCS([va_copy]) + +dnl Checking for va_copy availability +AC_MSG_CHECKING([for va_copy]) +AC_TRY_LINK([#include <stdarg.h> +va_list ap1,ap2;], [va_copy(ap1,ap2);], +have_va_copy=yes, +have_va_copy=no) +AC_MSG_RESULT($have_va_copy) +if test x"$have_va_copy" = x"yes"; then + AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) +else + AC_MSG_CHECKING([for __va_copy]) + AC_TRY_LINK([#include <stdarg.h> + va_list ap1,ap2;], [__va_copy(ap1,ap2);], + have___va_copy=yes, + have___va_copy=no) + AC_MSG_RESULT($have___va_copy) + if test x"$have___va_copy" = x"yes"; then + AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) + fi +fi + AC_ARG_ENABLE([ps3], [AS_HELP_STRING([--enable-ps3], [build support for the PS3 game console])], diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c index c660870..95a0a6a 100644 --- a/lib/talloc/talloc.c +++ b/lib/talloc/talloc.c @@ -26,19 +26,20 @@ inspired by http://swapped.cc/halloc/ */ - +#if defined(HAVE_CONFIG_H) #include "config.h" - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - +#else /* nfsim additions */ #define HAVE_SYS_TYPES_H #define HAVE_UNISTD_H #define HAVE_STDARG_H #define HAVE_STDINT_H #define HAVE_VA_COPY +#endif + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #ifdef HAVE_SYS_TYPES_H #include <sys/types.h> |