[glib/glib-2-30] Bug 659794: Define S_ISREG when it is not available



commit 21598c746670c9f5cb664d272d3a5f6b7a0dd966
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Sep 23 11:42:31 2011 +0800

    Bug 659794: Define S_ISREG when it is not available
    
    Not all compilers define S_ISREG on Windows, so define it in such
    situations

 glib/gmappedfile.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/glib/gmappedfile.c b/glib/gmappedfile.c
index f94bf31..8079a74 100644
--- a/glib/gmappedfile.c
+++ b/glib/gmappedfile.c
@@ -65,6 +65,14 @@
 #define MAP_FAILED ((void *) -1)
 #endif
 
+#ifdef G_OS_WIN32
+
+#ifndef S_ISREG
+#define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
+#endif
+
+#endif
+
 struct _GMappedFile 
 {
   gchar *contents;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]