]> granicus.if.org Git - postgis/commitdiff
Fix compile problems on non-GNU systems by using va_copy as an alias onto the real...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Tue, 7 Jul 2009 10:32:52 +0000 (10:32 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Tue, 7 Jul 2009 10:32:52 +0000 (10:32 +0000)
git-svn-id: http://svn.osgeo.org/postgis/branches/1.4@4263 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/vsprintf.c

index 5fad83a09710e8d93ac35b4292691ccb28c13b13..d3ec4a8dd1737e88ad2dd106667b599363b968e4 100644 (file)
@@ -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);
 }