talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 2b0553b47f8d6d01cc2590cb06fc17c8d6b58e68
parent 148266e4fdc3015f981b2b8150fc087e465711c4
Author: Paul Mangan <paul@claws-mail.org>
Date:   Fri,  1 Aug 2008 18:29:00 +0000

2008-08-01 [paul]	3.5.0cvs44

	* src/common/utils.c
	* src/plugins/pgpcore/claws.def
	* src/plugins/pgpinline/claws.def
		fix compilation problems on mingw32,
		(bug 1688) Patch by Marcus Brinkmann

Diffstat:
MChangeLog | 8++++++++
MPATCHSETS | 1+
Mconfigure.ac | 2+-
Msrc/common/utils.c | 31+++++++++++++++++++++++++++++--
Msrc/plugins/pgpcore/claws.def | 1+
Msrc/plugins/pgpinline/claws.def | 1+
6 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-01 [paul] 3.5.0cvs44 + + * src/common/utils.c + * src/plugins/pgpcore/claws.def + * src/plugins/pgpinline/claws.def + fix compilation problems on mingw32, + (bug 1688) Patch by Marcus Brinkmann + 2008-08-01 [colin] 3.5.0cvs43 * src/gtk/gtkutils.c diff --git a/PATCHSETS b/PATCHSETS @@ -3455,3 +3455,4 @@ ( cvs diff -u -r 1.12.2.52 -r 1.12.2.53 src/action.c; ) > 3.5.0cvs41.patchset ( cvs diff -u -r 1.382.2.461 -r 1.382.2.462 src/compose.c; cvs diff -u -r 1.26.2.37 -r 1.26.2.38 src/foldersel.c; cvs diff -u -r 1.274.2.259 -r 1.274.2.260 src/mainwindow.c; cvs diff -u -r 1.105.2.138 -r 1.105.2.139 src/prefs_account.c; cvs diff -u -r 1.52.2.65 -r 1.52.2.66 src/prefs_folder_item.c; cvs diff -u -r 1.1.2.29 -r 1.1.2.30 src/prefs_quote.c; cvs diff -u -r 1.395.2.378 -r 1.395.2.379 src/summaryview.c; cvs diff -u -r 1.9.2.56 -r 1.9.2.57 src/gtk/gtkaspell.c; cvs diff -u -r 1.5.2.76 -r 1.5.2.77 src/gtk/gtkutils.c; cvs diff -u -r 1.5.2.11 -r 1.5.2.12 src/gtk/gtkvscrollbutton.c; ) > 3.5.0cvs42.patchset ( cvs diff -u -r 1.5.2.77 -r 1.5.2.78 src/gtk/gtkutils.c; cvs diff -u -r 1.5.2.12 -r 1.5.2.13 src/gtk/gtkvscrollbutton.c; ) > 3.5.0cvs43.patchset +( cvs diff -u -r 1.36.2.142 -r 1.36.2.143 src/common/utils.c; cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/plugins/pgpcore/claws.def; cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/plugins/pgpinline/claws.def; ) > 3.5.0cvs44.patchset diff --git a/configure.ac b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=5 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=43 +EXTRA_VERSION=44 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/common/utils.c b/src/common/utils.c @@ -188,7 +188,7 @@ gint g_chmod(const gchar *path, gint mode) #ifdef G_OS_WIN32 -gint mkstemp_name(const gchar *template, gchar **name_used) +gint mkstemp_name(gchar *template, gchar **name_used) { static gulong count=0; /* W32-_mktemp only supports up to 27 tempfiles... */ @@ -209,7 +209,7 @@ gint mkstemp_name(const gchar *template, gchar **name_used) #endif /* G_OS_WIN32 */ #ifdef G_OS_WIN32 -gint mkstemp(const gchar *template) +gint mkstemp(gchar *template) { gchar *dummyname; gint res = mkstemp_name(template, &dummyname); @@ -2926,7 +2926,9 @@ FILE *my_tmpfile(void) gchar *fname; gint fd; FILE *fp; +#ifndef G_OS_WIN32 gchar buf[2]="\0"; +#endif tmpdir = get_tmp_dir(); tmplen = strlen(tmpdir); @@ -3092,10 +3094,12 @@ static gchar *file_read_to_str_full(const gchar *file, gboolean recode) FILE *fp; gchar *str; struct stat s; +#ifndef G_OS_WIN32 gint fd, err; struct timeval timeout = {1, 0}; fd_set fds; int fflags = 0; +#endif g_return_val_if_fail(file != NULL, NULL); @@ -3108,12 +3112,21 @@ static gchar *file_read_to_str_full(const gchar *file, gboolean recode) return NULL; } +#ifdef G_OS_WIN32 + fp = fopen (file, "rb"); + if (fp == NULL) { + FILE_OP_ERROR(file, "open"); + return NULL; + } +#else + fd = open(file, O_RDONLY | O_NONBLOCK); /* test whether the file is readable without blocking */ fd = open(file, O_RDONLY | O_NONBLOCK); if (fd == -1) { FILE_OP_ERROR(file, "open"); return NULL; } + FD_ZERO(&fds); FD_SET(fd, &fds); @@ -3149,6 +3162,7 @@ static gchar *file_read_to_str_full(const gchar *file, gboolean recode) close(fd); /* if fp isn't NULL, we'll use fclose instead! */ return NULL; } +#endif str = file_read_stream_to_str_full(fp, recode); @@ -3443,7 +3457,9 @@ time_t tzoffset_sec(time_t *now) { struct tm gmt, *lt; gint off; +#ifndef G_OS_WIN32 struct tm buf1, buf2; +#endif gmt = *gmtime_r(now, &buf1); lt = localtime_r(now, &buf2); @@ -3474,7 +3490,9 @@ gchar *tzoffset(time_t *now) struct tm gmt, *lt; gint off; gchar sign = '+'; +#ifndef G_OS_WIN32 struct tm buf1, buf2; +#endif gmt = *gmtime_r(now, &buf1); lt = localtime_r(now, &buf2); @@ -3509,8 +3527,10 @@ void get_rfc822_date(gchar *buf, gint len) time_t t; gchar day[4], mon[4]; gint dd, hh, mm, ss, yyyy; +#ifndef G_OS_WIN32 struct tm buf1; gchar buf2[BUFFSIZE]; +#endif t = time(NULL); lt = localtime_r(&t, &buf1); @@ -3695,7 +3715,9 @@ gchar *generate_msgid(gchar *buf, gint len) struct tm *lt; time_t t; gchar *addr; +#ifndef G_OS_WIN32 struct tm buft; +#endif t = time(NULL); lt = localtime_r(&t, &buft); @@ -5066,6 +5088,11 @@ size_t fast_strftime(gchar *buf, gint buflen, const gchar *format, struct tm *lt gboolean prefs_common_get_use_shred(void); + +#ifdef G_OS_WIN32 +#define WEXITSTATUS(x) (x) +#endif + int claws_unlink(const gchar *filename) { struct stat s; diff --git a/src/plugins/pgpcore/claws.def b/src/plugins/pgpcore/claws.def @@ -5,6 +5,7 @@ alertpanel alertpanel_error alertpanel_full check_plugin_version +claws_unlink copy_file_part debug_print_real debug_srcname diff --git a/src/plugins/pgpinline/claws.def b/src/plugins/pgpinline/claws.def @@ -1,5 +1,6 @@ LIBRARY CLAWS-MAIL.EXE EXPORTS +claws_unlink check_plugin_version codeconv_set_strict conv_codeset_strdup