可變參數(shù)列表之va_copy
2013-01-16 23:18:34
分類: C/C++
把Linux下的程序移植到vc 6上,有不支持va_copy的報錯為“undefined reference to
va_copy”,查閱了許多資料,最終在國外找到了說明。 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中對其進行了支持。但是如果不支持怎么辦? 如下定義可以解決問題: 代碼:
這個是照抄別人的。 |
|