c - printf macro for compiler with and without support for VARIADIC -
please me writing printf
macro 1 compiler supports variadic , not.
for instance:
#ifdef have__va_args printf macro #else printf macro
an solution variadic can lock this.
#define my_printf(_format, ...) { \ printf(_format, __va_args__); \ }
and if have compiler without variadic, have implement function variable argument list.
#include <stdarg.h> #include <std.h> int my_printf(const char *format, ...) { va_list ap; va_start(ap, dst); return vprintf(format, ap); }
Comments
Post a Comment