After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 311630 - unistd.h error in gtkfilechooserdefault.c
unistd.h error in gtkfilechooserdefault.c
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.7.x
Other All
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-07-26 17:35 UTC by Kazuki Iwamoto
Modified: 2005-07-26 18:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kazuki Iwamoto 2005-07-26 17:35:12 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:
Comment 1 Matthias Clasen 2005-07-26 18:47:17 UTC
2005-07-26  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkfilechooserdefault.c: Fix up includes on Win32.  
	(#311630, Kazuki Iwamoto)