Does Visual C++ have something similar to __builtin_va_arg_pack?
This built-in function represents all anonymous arguments of an inline
function. It can be used only in inline functions which will be always
inlined, never compiled as a separate function, such as those using
attribute ((always_inline)) or attribute ((gnu_inline)) extern inline functions. It must be only passed as
last argument to some other function with variable arguments. This is
useful for writing small wrapper inlines for variable argument
functions, when using preprocessor macros is undesirable. For example:extern int myprintf (FILE *f, const char *format, ...); extern inline __attribute__ ((__gnu_inline__)) int myprintf (FILE *f, const char *format, ...) { int r = fprintf (f, "myprintf: "); if (r < 0) return r; int s = fprintf (f, format, __builtin_va_arg_pack ()); if (s < 0) return s; return r + s; }
Not that I know of. But there’s no need to use a gcc extension here, use vfprintf instead: