#include <stdio.h>
#include <stdarg.h>

#define PRINTFFORMAT(formatarg, firstvalue) __attribute__((__format__(printf, formatarg, firstvalue)))
#define GNUPRINTFFORMAT(formatarg, firstvalue) __attribute__((__format__(gnu_printf, formatarg, firstvalue)))

void myprint (const char *format, ...) PRINTFFORMAT (1, 2);
void mymingwprint (const char *format, ...) PRINTFFORMAT (1, 2);
void myfakegnuprint (const char *format, ...) GNUPRINTFFORMAT (1, 2);
void mygnuprint (const char *format, ...) GNUPRINTFFORMAT (1, 2);

void
myprint (const char *format, ...)
{
       va_list ap;
     
       va_start (ap, format);
       vprintf (format, ap);
       va_end (ap);
}

void
myfakegnuprint (const char *format, ...)
{
       va_list ap;
     
       va_start (ap, format);
       vprintf (format, ap);
       va_end (ap);
}

void
mymingwprint (const char *format, ...)
{
       va_list ap;
     
       va_start (ap, format);
       __mingw_vprintf (format, ap);
       va_end (ap);
}


void
mygnuprint (const char *format, ...)
{
       va_list ap;
     
       va_start (ap, format);
       __mingw_vprintf (format, ap);
       va_end (ap);
}

int
main (int argc, char **argv)
{
  size_t x = 0;
  myfakegnuprint ("on line %d sizeof x is %zu (format gnu_printf, implementation ms)\n", __LINE__, sizeof (x));
  mygnuprint ("on line %d sizeof x is %zu (format gnu_printf, implementation mingw)\n", __LINE__, sizeof (x));
  myprint ("on line %d sizeof x is %zu (format printf, implementation ms)\n", __LINE__, sizeof (x));
  mymingwprint ("on line %d sizeof x is %zu (format printf, implementation mingw)\n", __LINE__, sizeof (x));
  return 0;
}
