GNOME Bugzilla – Bug 323052
gslice.c: unistd.h error and C99ism
Last modified: 2005-12-02 20:11:45 UTC
Please describe the problem: unistd.h is included unconditionally and sysconf is not on Windows. Because of C99ism in the file gslice.c, glib does not compile. Steps to reproduce: 1. compile by Visual C++ Actual results: following message is displayed. glib\gslice.c(22) : fatal error C1083: Cannot open include file: 'unistd.h' : No such file or directory Expected results: "#include <unistd.h>" should be surrounded by "#ifdef HAVE_UNISTD_H" and "#endif". GetSystemInfo API is useful on Windows as sysconf API. And the declaration have to be moved to top of block. Does this happen every time? every time Other information:
Created attachment 55550 [details] [review] patch for glib/gslice.c
2005-12-02 Matthias Clasen <mclasen@redhat.com> * glib/gslice.c: Win32 portability fixes and C99ism removal, pointed out by Kazuki Iwamoto. (#323052)