From f330a9027e457339fb798c72ed1d2c624cfec907 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 7 Jul 2009 10:32:52 +0000 Subject: [PATCH] Fix compile problems on non-GNU systems by using va_copy as an alias onto the real version. Per report from Stefano Bonnin. git-svn-id: http://svn.osgeo.org/postgis/branches/1.4@4263 b70326c6-7e19-0410-871a-916f4a2858ee --- liblwgeom/vsprintf.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/liblwgeom/vsprintf.c b/liblwgeom/vsprintf.c index 5fad83a09..d3ec4a8dd 100644 --- a/liblwgeom/vsprintf.c +++ b/liblwgeom/vsprintf.c @@ -36,6 +36,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ int global_total_width; #endif +/* Make sure we have a va_copy that will work on all platforms */ +#ifndef va_copy +# ifdef __va_copy +# define va_copy(d, s) __va_copy((d), (s)) +# else +# define va_copy(d, s) memcpy(&(d), &(s), sizeof(va_list)) +# endif +#endif int lw_vasprintf (char **result, const char *format, va_list args); int lw_asprintf @@ -146,8 +154,7 @@ va_list args; { va_list temp; - /* Use va_copy for compatibility with both 32 and 64 bit args */ - __va_copy(temp, args); + va_copy(temp, args); return int_vasprintf (result, format, &temp); } -- 2.49.0