diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-08-08 07:07:19 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-08-08 07:07:19 +0000 |
commit | e5c03181ba3cd06f27e10677960575e44e7900a6 (patch) | |
tree | cfa341f7b9c46b2c7b692e11def79e72622152ab /src/utils.h | |
parent | 38ad5762fb87ec8278108d4a8d06e32612e64a13 (diff) |
added wrappers for C library function that take pathname arguments.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@478 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h index 85f1ec2f..976525d8 100644 --- a/src/utils.h +++ b/src/utils.h @@ -39,6 +39,37 @@ # include <wchar.h> #endif +/* Wrappers for C library function that take pathname arguments. */ +#if GLIB_CHECK_VERSION(2, 6, 0) +# include <glib/gstdio.h> +#else + +#define g_open open +#define g_rename rename +#define g_mkdir mkdir +#define g_stat stat +#define g_lstat lstat +#define g_unlink unlink +#define g_remove remove +#define g_rmdir rmdir +#define g_fopen fopen +#define g_freopen freopen + +#endif /* GLIB_CHECK_VERSION */ + +#if !GLIB_CHECK_VERSION(2, 7, 0) + +#ifdef G_OS_UNIX +#define g_chdir chdir +#define g_chmod chmod +#else +gint g_chdir (const gchar *path); +gint g_chmod (const gchar *path, + gint mode); +#endif /* G_OS_UNIX */ + +#endif /* !GLIB_CHECK_VERSION */ + /* The AC_CHECK_SIZEOF() in configure fails for some machines. * we provide some fallback values here */ #if !SIZEOF_UNSIGNED_SHORT @@ -141,6 +172,7 @@ #define FILE_OP_ERROR(file, func) \ { \ fprintf(stderr, "%s: ", file); \ + fflush(stderr); \ perror(func); \ } |