From 4f9bc0db18ebf839e7ad88b13d84655816b4b805 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 8 May 2006 13:13:13 +0000 Subject: New module 'stdarg'. --- m4/ChangeLog | 4 ++++ m4/stdarg.m4 | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 m4/stdarg.m4 (limited to 'm4') diff --git a/m4/ChangeLog b/m4/ChangeLog index b60da3c0e2..97b0dca136 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,7 @@ +2006-05-08 Bruno Haible + + * stdarg.m4: New file, from GNU gettext. + 2006-05-05 Jim Meyering * warning.m4: New file, derived from bison's file by the same name. diff --git a/m4/stdarg.m4 b/m4/stdarg.m4 new file mode 100644 index 0000000000..3424d414b7 --- /dev/null +++ b/m4/stdarg.m4 @@ -0,0 +1,39 @@ +# stdarg.m4 serial 1 +dnl Copyright (C) 2006 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Bruno Haible. +dnl Provide a working va_copy in combination with . + +AC_DEFUN([gl_STDARG_H], +[ + AC_MSG_CHECKING([for va_copy]) + AC_CACHE_VAL([gl_cv_func_va_copy], [ + AC_TRY_COMPILE([#include ], [ +#ifndef va_copy +void (*func) (va_list, va_list) = va_copy; +#endif +], + [gl_cv_func_va_copy=yes], [gl_cv_func_va_copy=no])]) + AC_MSG_RESULT([$gl_cv_func_va_copy]) + if test $gl_cv_func_va_copy = no; then + # Provide a substitute, either __va_copy or as a simple assignment. + AC_CACHE_VAL([gl_cv_func___va_copy], [ + AC_TRY_COMPILE([#include ], [ +#ifndef __va_copy +error, bail out +#endif +], + [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])]) + if test $gl_cv_func___va_copy = yes; then + AC_DEFINE([va_copy], [__va_copy], + [Define as a macro for copying va_list variables.]) + else + AH_VERBATIM([#define gl_va_copy(a,b) (a) = (b)]) + AC_DEFINE([va_copy], [gl_va_copy], + [Define as a macro for copying va_list variables.]) + fi + fi +]) -- cgit v1.2.1