分类: C/C++
2013-01-16 23:18:34
va_copy is c99 - anything before that, and its upto the compiler... as pointed out, gcc 2.95 dosnt have it,depends on your definition of absolutely ancient, but the gcc 2.95.4 that comes with freebsd 4.x does not support va_copy
C99中对其进行了支持。但是如果不支持怎么办?
如下定义可以解决问题:
代码:
#ifndef va_copy # ifdef __va_copy # define va_copy(DEST,SRC) __va_copy((DEST),(SRC)) # else # define va_copy(DEST, SRC) memcpy((&DEST), (&SRC), sizeof(va_list)) # endif #endif |
这个是照抄别人的。