GNOME Bugzilla – Bug 311630
unistd.h error in gtkfilechooserdefault.c
Last modified: 2005-07-26 18:47:17 UTC
Please describe the problem: unistd.h is included unconditionally. Function 'access' needs to include io.h on Visual C++. And F_OK is not defined on Visual C++. Steps to reproduce: 1. compile by Visual C++ 6.0 Actual results: following messages are displayed. gtkfilechooserdefault.c(88) : fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory gtkfilechooserdefault.c(116) : error C4013: 'access' undefined; assuming extern returning int gtkfilechooserdefault.c(116) : error C2065: 'F_OK' : undeclared identifier Expected results: I think that we should use g_file_test. http://developer.gnome.org/doc/API/2.0/glib/glib-File-Utilities.html#g-file-test If we don't use it, we have to do following. 1. Surround "#include <unistd.h>" by "#ifdef HAVE_UNISTD_H" and "#endif". 2. Include io.h on Visual C++. 3. Define F_OK when it's undefined. Does this happen every time? every time Other information:
2005-07-26 Matthias Clasen <mclasen@redhat.com> * gtk/gtkfilechooserdefault.c: Fix up includes on Win32. (#311630, Kazuki Iwamoto)