Przeglądaj źródła

fix building under FreeBSD/amd64 (where assigning a va_list is absolutely impossible) and building under Solaris (where no vasprintf exists)

Ralf S. Engelschall 19 lat temu
rodzic
commit
ec6cdc95de
2 zmienionych plików z 54 dodań i 1 usunięć
  1. 51 0
      axl/axl.patch
  2. 3 1
      axl/axl.spec

+ 51 - 0
axl/axl.patch

@@ -0,0 +1,51 @@
+Index: src/axl_stream.c
+--- src/axl_stream.c.orig	2006-09-21 20:48:00 +0200
++++ src/axl_stream.c	2006-10-12 10:38:56 +0200
+@@ -1152,7 +1152,11 @@
+ 	stream->accept_terminator = accept_terminator;
+ 	stream->result_size       = (result_size != NULL);
+ 	stream->chunk_num         = chunk_num;
++#ifdef __GNUC__
++	__builtin_va_copy(stream->args, args);
++#else
+ 	stream->args              = args;
++#endif
+ 
+ 	/* call to current implementation */
+ 	result = __axl_stream_get_untilv_wide (stream);
+@@ -1856,7 +1860,7 @@
+ char  * axl_stream_strdup_printfv    (char * chunk, va_list args)
+ {
+ 
+-#ifdef __AXL_WIN32__
++#if 1
+ 	int       size;
+ #endif
+ 	char    * result   = NULL;
+@@ -1864,7 +1868,7 @@
+ 
+ 	axl_return_val_if_fail (chunk, NULL);
+ 
+-#ifdef __AXL_POSIX__
++#if 0
+ 	/* do the operation using the GNU extension */
+ 	new_size = vasprintf (&result, chunk, args);
+ #else
+@@ -1898,7 +1902,7 @@
+  */
+ char    * axl_stream_strdup_printf_len (char * chunk, int * chunk_size, ...)
+ {
+-#ifdef __AXL_WIN32__
++#if 1
+ 	int       size;
+ #endif
+ 	int       new_size;
+@@ -1910,7 +1914,7 @@
+ 	/* open std args */
+ 	va_start (args, chunk_size);
+ 
+-#ifdef __AXL_POSIX__
++#if 0
+ 	/* do the operation using the GNU extension */
+ 	new_size = vasprintf (&result, chunk, args);
+ #else

+ 3 - 1
axl/axl.spec

@@ -37,10 +37,11 @@ Class:        EVAL
 Group:        XML
 License:      LGPL
 Version:      %{V_external}
-Release:      20061008
+Release:      20061012
 
 #   list of sources
 Source0:      http://switch.dl.sourceforge.net/vortexlibrary/axl-%{V_external}.%{V_internal}.tar.gz
+Patch0:       axl.patch
 
 #   build information
 Prefix:       %{l_prefix}
@@ -63,6 +64,7 @@ AutoReqProv:  no
 
 %prep
     %setup -q -n axl-%{V_external}.%{V_internal}
+    %patch -p0
 
 %build
     CC="%{l_cc}" \