/* defined in GIMP's config.h*/
#define _FILE_OFFSET_BITS 64
#include <glib/gstdio.h>

int 
main ()
{
#ifdef __MINGW32_VERSION
  g_printerr ("mingw32 version: %s\n", G_STRINGIFY (__MINGW32_VERSION));
#elif defined __MINGW64_VERSION_MAJOR
#ifdef _WIN64
  g_printerr ("mingw64 version: %s (_WIN64)\n", __MINGW64_VERSION_STR);
#else
  g_printerr ("mingw64 version: %s\n", __MINGW64_VERSION_STR);
#endif
#endif

  system ("echo helloworld > out.txt && type out.txt");

  g_printerr ("\nstat is #define'd to '%s'\n", G_STRINGIFY (stat));
  g_printerr ("_wstat is #define'd to '%s'\n\n", G_STRINGIFY (_wstat));
  {
    GStatBuf sb;
    g_stat ("out.txt", &sb);

    g_printerr ("\nGStatBuf\nsize: %u\natime: %u\nmtime: %u\nctime: %u\n",
                sb.st_size, sb.st_atime, sb.st_mtime, sb.st_ctime);
  }
  {
    struct stat sb;

    g_stat ("out.txt", &sb);

    g_printerr ("\nstruct stat\nsize: %u\natime: %u\nmtime: %u\nctime: %u\n",
                sb.st_size, sb.st_atime, sb.st_mtime, sb.st_ctime);
  }
#ifndef __MINGW32_VERSION
  {
    struct _stat64i32 sb;

    g_stat ("out.txt", (GStatBuf*)&sb);

    g_printerr ("\nstruct _stat64i32\nsize: %u\natime: %u\nmtime: %u\nctime: %u\n",
                sb.st_size, sb.st_atime, sb.st_mtime, sb.st_ctime);
  }
#endif
  return 0;
}
