gmappedfile.c: Define S_IFREG on Win32 when it's not available
authorChun-wei Fan <fanchunwei@src.gnome.org>
Thu, 22 Sep 2011 14:10:23 +0000 (22:10 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 23 Sep 2011 01:36:37 +0000 (09:36 +0800)
Make a workaround for S_IFREG in gmappedfile.c on Windows as it may not be
available for a given compiler on that platform

glib/gmappedfile.c

index 8d7d0fa..57af411 100644 (file)
 #define fstat(a,b) _fstati64(a,b)
 #define stat _stati64
 
+#ifndef S_ISREG
+#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
+#endif
+
 #endif
 
 #include "gconvert.h"