From: Tor Lillqvist Date: Tue, 30 Mar 2010 17:46:46 +0000 (+0300) Subject: Fix build breakage on Unix X-Git-Tag: 2.25.0~82 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8470ed55ad3bf29cdc8c151b76c4f14b6be928a;p=platform%2Fupstream%2Fglib.git Fix build breakage on Unix --- diff --git a/glib/gstdio.h b/glib/gstdio.h index cc094cb..b92eb6c 100644 --- a/glib/gstdio.h +++ b/glib/gstdio.h @@ -27,6 +27,31 @@ G_BEGIN_DECLS +#if defined (_MSC_VER) && !defined(_WIN64) + +/* Make it clear that we mean the struct with 32-bit st_size and + * 32-bit st_*time fields as that is how the 32-bit GLib DLL normally + * has been compiled. If you get a compiler warning when calling + * g_stat(), do take it seriously and make sure that the type of + * struct stat the code in GLib fills in matches the struct the type + * of struct stat you pass to g_stat(). To avoid hassle, to get file + * attributes just use the GIO API instead which doesn't use struct + * stat. + * + * Sure, it would be nicer to use a struct with 64-bit st_size and + * 64-bit st_*time fields, but changing that now would break ABI. And + * in MinGW, a plain "struct stat" is the one with 32-bit st_size and + * st_*time fields. + */ + +typedef struct _stat32 GStatBuf; + +#else + +typedef struct stat GStatBuf; + +#endif + #if defined(G_OS_UNIX) && !defined(G_STDIO_NO_WRAP_ON_UNIX) /* Just pass on to the system functions, so there's no potential for data @@ -89,31 +114,6 @@ int g_mkdir (const gchar *filename, int g_chdir (const gchar *path); -#if defined (_MSC_VER) && !defined(_WIN64) - -/* Make it clear that we mean the struct with 32-bit st_size and - * 32-bit st_*time fields as that is how the 32-bit GLib DLL normally - * has been compiled. If you get a compiler warning when calling - * g_stat(), do take it seriously and make sure that the type of - * struct stat the code in GLib fills in matches the struct the type - * of struct stat you pass to g_stat(). To avoid hassle, to get file - * attributes just use the GIO API instead which doesn't use struct - * stat. - * - * Sure, it would be nicer to use a struct with 64-bit st_size and - * 64-bit st_*time fields, but changing that now would break ABI. And - * in MinGW, a plain "struct stat" is the one with 32-bit st_size and - * st_*time fields. - */ - -typedef struct _stat32 GStatBuf; - -#else - -typedef struct stat GStatBuf; - -#endif - int g_stat (const gchar *filename, GStatBuf *buf);