va_copy?
-
The va_copy() (function/macro) doesn't seem to be in my Visual Studio 2005; or at least I'm getting an "identifier not found" error. Perhaps I need to point my include directory differently??? Failing that, does anybody know a reliable definition for it? I've searched MSDN and didn't find anything. David
-
The va_copy() (function/macro) doesn't seem to be in my Visual Studio 2005; or at least I'm getting an "identifier not found" error. Perhaps I need to point my include directory differently??? Failing that, does anybody know a reliable definition for it? I've searched MSDN and didn't find anything. David
I don't know what it does, but maybe you need to implement your own using va_arg, va_end, va_start[^] Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
The va_copy() (function/macro) doesn't seem to be in my Visual Studio 2005; or at least I'm getting an "identifier not found" error. Perhaps I need to point my include directory differently??? Failing that, does anybody know a reliable definition for it? I've searched MSDN and didn't find anything. David
If all else fails, you could roll your own, something like:
#define va_copy(dest, src) ((void)((dest) = (src)))
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
If all else fails, you could roll your own, something like:
#define va_copy(dest, src) ((void)((dest) = (src)))
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
Thanks for the thought. Unfortunately, it's not that easy. These functions are compiler supplied for a good reason; they're inherently low-level and depend strongly on how the compiler pushes and pops the stack, alignment issues, and perhaps other things. I have seen one implementation where va_copy(dest, src) was a simple assignment of src to dest. But, on the other hand, if you've looked at Microsoft's implementation of va_start() etc. you know that a simple assignment may be WAY to naive. It MIGHT work, but then again, it might not. Or worse yet, it might work SOMETIMES. If someone out there KNOWS how it should be implemented in Visual Studio, I'll certainly try it, but I hate to just guess. David