diff options
Diffstat (limited to 'wsutil/file_util.h')
-rw-r--r-- | wsutil/file_util.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/wsutil/file_util.h b/wsutil/file_util.h index 833518a9bc..dff51bbe83 100644 --- a/wsutil/file_util.h +++ b/wsutil/file_util.h @@ -32,12 +32,20 @@ extern "C" { #include <glib.h> #ifdef _WIN32 -#include <io.h> +#include <io.h> /* for _read(), _write(), etc. */ #include <gmodule.h> #endif +#ifdef HAVE_FCNTL_H +#include <fcntl.h> /* for open() */ +#endif + +#ifdef HAVE_UNISTD_H +#include <unistd.h> /* for read(), write(), close(), etc. */ +#endif + #ifdef HAVE_SYS_STAT_H -#include <sys/stat.h> +#include <sys/stat.h> /* for stat() and struct stat */ #endif /* @@ -59,6 +67,8 @@ extern "C" { #define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) #endif +#include <stdio.h> + #ifdef _WIN32 /* @@ -81,8 +91,6 @@ extern "C" { * removing the target if necessary. */ -#include <stdio.h> - WS_DLL_PUBLIC int ws_stdio_open (const gchar *filename, int flags, int mode); WS_DLL_PUBLIC int ws_stdio_rename (const gchar *oldfilename, const gchar *newfilename); WS_DLL_PUBLIC int ws_stdio_mkdir (const gchar *filename, int mode); @@ -192,9 +200,7 @@ WS_DLL_PUBLIC void create_app_running_mutex(); #define ws_dir_rewind g_dir_rewind #define ws_dir_close g_dir_close -/* XXX - remove include "dirent.h" */ -/* XXX - remove include "direct.h" */ -/* XXX - remove include "sys/stat.h" */ +/* XXX - remove include "sys/stat.h" from files that include this header */ /* XXX - update docs (e.g. README.developer) */ #ifdef __cplusplus |