[xiph-cvs] cvs commit: net sock.c

Segher Boessenkool segher at koffie.nl
Tue Jul 8 22:55:20 PDT 2003



Brendan Cully wrote:
>>>>  va_copy is undefined on windows
>>>
>>>>+#define va_copy(ap1, ap2) ((ap1) = (ap2))
>>>
>>>This won't work on some windows compilers (where va_list is, I think, an
>>>array).
>>>
>>>Mike
>>
>>with MSVC, va_list is a pointer (char * actually)...I'm not sure what it is 
>>under cygwin/gcc....so the question is, how many win32 compilers do we want 
>>to support, or is MSVC adequate ?
> 
> Let's just use memcpy.

Neither of these will work in general; the underlying
data types can be arbitrary general, and va_end() will
do double free()'s, etc.  If your C implementation
doesn't provide the macro va_copy(), it's not actually C.

Best you can do is make a replacement macro per *exact*
system, i.e. keyed on specific compiler/environment versions.

I'm sorry.

<p>Segher

<p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list