GNOME Bugzilla – Bug 158469
problem of macros, S_IF* and S_IS* (gkeyfile.c)
Last modified: 2004-12-22 21:47:04 UTC
Please describe the problem: There is no S_ISREG in headers of Visual C++. Please see the following bug-reports. http://bugzilla.gnome.org/show_bug.cgi?id=156728 http://bugzilla.gnome.org/show_bug.cgi?id=158263 Steps to reproduce: 1. compile by Visual C++ 6.0 Actual results: The following message is displayed. gkeyfile.c(362) : error C4013: 'S_ISREG' undefined; assuming extern returning int Expected results: #156728 conflicts with #158263. So, I suggest inserting the following macros to gstdio.h. #ifdef S_IFMT #define G_S_IFMT S_IFMT #else #define G_S_IFMT 0170000 #endif #ifdef S_IFREG #define G_S_IFREG S_IFREG #else #define G_S_IFREG 0100000 #endif #ifdef S_IFDIR #define G_S_IFDIR S_IFDIR #else #define G_S_IFDIR 0040000 #endif #ifdef S_IFCHR #define G_S_IFCHR S_IFCHR #else #define G_S_IFCHR 0020000 #endif #ifdef S_IFBLK #define G_S_IFBLK S_IFBLK #else #define G_S_IFBLK 0060000 #endif #ifdef S_IFIFO #define G_S_IFIFO S_IFIFO #else #define G_S_IFIFO 0010000 #endif #ifdef S_IFLNK #define G_S_IFLNK S_IFLNK #else #define G_S_IFLNK 0120000 #endif #ifdef S_IFSOCK #define G_S_IFSOCK S_IFSOCK #else #define G_S_IFSOCK 0140000 #endif #ifdef S_ISREG #define G_S_ISREG S_ISREG #else #define G_S_ISREG(m) (((m) & G_S_IFMT) == G_S_IFREG) #endif #ifdef S_ISDIR #define G_S_ISDIR S_ISDIR #else #define G_S_ISDIR(m) (((m) & G_S_IFMT) == G_S_IFDIR) #endif #ifdef S_ISCHR #define G_S_ISCHR S_ISCHR #else #define G_S_ISCHR(m) (((m) & G_S_IFMT) == G_S_IFCHR) #endif #ifdef S_ISBLK #define G_S_ISBLK S_ISBLK #else #define G_S_ISBLK(m) (((m) & G_S_IFMT) == G_S_IFBLK) #endif #ifdef S_ISFIFO #define G_S_ISFIFO S_ISFIFO #else #define G_S_ISFIFO(m) (((m) & G_S_IFMT) == G_S_IFIFO) #endif #ifdef S_ISLNK #define G_S_ISLNK S_ISLNK #else #define G_S_ISLNK(m) (((m) & G_S_IFMT) == G_S_IFLNK) #endif #ifdef S_ISSOCK #define G_S_ISSOCK S_ISSOCK #else #define G_S_ISSOCK(m) (((m) & G_S_IFMT) == G_S_IFSOCK) #endif Does this happen every time? every time Other information:
Fixed