[evolution-data-server/gnome-2-32] Miscellaneous build fixes for Windows



commit 713cd2669b4da8104b6640cc85d9346e0ddf52fa
Author: Fridrich Å trba <fridrich strba bluewin ch>
Date:   Thu Feb 17 15:30:59 2011 +0100

    Miscellaneous build fixes for Windows

 camel/camel-sasl-gssapi.c                     |    7 +++++--
 camel/providers/local/Makefile.am             |   12 ++++++------
 camel/providers/local/camel-maildir-store.c   |   22 +++++++++++-----------
 camel/providers/local/camel-maildir-summary.c |    6 +++++-
 camel/providers/local/camel-mh-store.c        |    2 +-
 libedataserverui/e-name-selector-dialog.c     |    4 ++++
 6 files changed, 32 insertions(+), 21 deletions(-)
---
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index 8de3799..61b3404 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -28,11 +28,14 @@
 
 #include <errno.h>
 
-#include <netdb.h>
 #include <string.h>
-#include <sys/socket.h>
 #include <sys/types.h>
 
+#ifndef _WIN32
+#include <netdb.h>
+#include <sys/socket.h>
+#endif
+
 #include <gio/gio.h>
 #include <glib/gi18n-lib.h>
 
diff --git a/camel/providers/local/Makefile.am b/camel/providers/local/Makefile.am
index 3f7bc7a..cb52ac9 100644
--- a/camel/providers/local/Makefile.am
+++ b/camel/providers/local/Makefile.am
@@ -5,12 +5,6 @@ if OS_WIN32
 SYSDEP_PROVIDER_SOURCES =
 else
 SYSDEP_PROVIDER_SOURCES = \
-	camel-mh-folder.c			\
-	camel-mh-store.c			\
-	camel-mh-summary.c			\
-	camel-maildir-folder.c			\
-	camel-maildir-store.c			\
-	camel-maildir-summary.c			\
 	camel-spool-folder.c			\
 	camel-spool-store.c			\
 	camel-spool-summary.c
@@ -32,6 +26,12 @@ libcamellocal_la_SOURCES = 			\
 	camel-mbox-folder.c			\
 	camel-mbox-store.c			\
 	camel-mbox-summary.c			\
+	camel-mh-folder.c			\
+	camel-mh-store.c			\
+	camel-mh-summary.c			\
+	camel-maildir-folder.c			\
+	camel-maildir-store.c			\
+	camel-maildir-summary.c			\
 	$(SYSDEP_PROVIDER_SOURCES)
 
 noinst_HEADERS =				\
diff --git a/camel/providers/local/camel-maildir-store.c b/camel/providers/local/camel-maildir-store.c
index 7fbf1f3..0c1aedd 100644
--- a/camel/providers/local/camel-maildir-store.c
+++ b/camel/providers/local/camel-maildir-store.c
@@ -127,9 +127,9 @@ get_folder (CamelStore *store,
 		if (g_stat(tmp, &st) != 0 || !S_ISDIR(st.st_mode)
 		    || g_stat(cur, &st) != 0 || !S_ISDIR(st.st_mode)
 		    || g_stat(new, &st) != 0 || !S_ISDIR(st.st_mode)) {
-			if (mkdir(tmp, 0700) != 0
-			    || mkdir(cur, 0700) != 0
-			    || mkdir(new, 0700) != 0) {
+			if (g_mkdir_with_parents(tmp, 0700) != 0
+			    || g_mkdir_with_parents(cur, 0700) != 0
+			    || g_mkdir_with_parents(new, 0700) != 0) {
 				g_set_error (
 					error, G_IO_ERROR,
 					g_io_error_from_errno (errno),
@@ -157,10 +157,10 @@ get_folder (CamelStore *store,
 				_("Cannot get folder '%s': folder does not exist."),
 				folder_name);
 		} else {
-			if (mkdir(name, 0700) != 0
-			    || mkdir(tmp, 0700) != 0
-			    || mkdir(cur, 0700) != 0
-			    || mkdir(new, 0700) != 0) {
+			if (g_mkdir_with_parents(name, 0700) != 0
+			    || g_mkdir_with_parents(tmp, 0700) != 0
+			    || g_mkdir_with_parents(cur, 0700) != 0
+			    || g_mkdir_with_parents(new, 0700) != 0) {
 				g_set_error (
 					error, G_IO_ERROR,
 					g_io_error_from_errno (errno),
@@ -272,10 +272,10 @@ delete_folder (CamelStore *store,
 
 		if (err != 0) {
 			/* easier just to mkdir all (and let them fail), than remember what we got to */
-			mkdir(name, 0700);
-			mkdir(cur, 0700);
-			mkdir(new, 0700);
-			mkdir(tmp, 0700);
+			g_mkdir_with_parents(name, 0700);
+			g_mkdir_with_parents(cur, 0700);
+			g_mkdir_with_parents(new, 0700);
+			g_mkdir_with_parents(tmp, 0700);
 			g_set_error (
 				error, G_IO_ERROR,
 				g_io_error_from_errno (err),
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index cb012bc..a43481b 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -31,7 +31,11 @@
 #include <unistd.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#ifndef _WIN32
 #include <sys/uio.h>
+#else
+#include <winsock2.h>
+#endif
 
 #include <glib/gstdio.h>
 #include <glib/gi18n-lib.h>
@@ -373,7 +377,7 @@ static gchar *maildir_summary_next_uid_string(CamelFolderSummary *s)
 			if (retry > 0) {
 				g_free(name);
 				g_free(uid);
-				sleep(2);
+				g_usleep(2*G_USEC_PER_SEC);
 			}
 			uid = g_strdup_printf("%ld.%d_%u.%s", time(NULL), getpid(), nextuid, mds->priv->hostname);
 			name = g_strdup_printf("%s/tmp/%s", cls->folder_path, uid);
diff --git a/camel/providers/local/camel-mh-store.c b/camel/providers/local/camel-mh-store.c
index 2da64d6..85134f7 100644
--- a/camel/providers/local/camel-mh-store.c
+++ b/camel/providers/local/camel-mh-store.c
@@ -227,7 +227,7 @@ get_folder (CamelStore *store,
 			return NULL;
 		}
 
-		if (mkdir(name, 0777) != 0) {
+		if (g_mkdir_with_parents(name, 0777) != 0) {
 			g_set_error (
 				error, G_IO_ERROR,
 				g_io_error_from_errno (errno),
diff --git a/libedataserverui/e-name-selector-dialog.c b/libedataserverui/e-name-selector-dialog.c
index e48ca0f..c2de2be 100644
--- a/libedataserverui/e-name-selector-dialog.c
+++ b/libedataserverui/e-name-selector-dialog.c
@@ -21,6 +21,10 @@
  * Author: Hans Petter Jansson <hpj novell com>
  */
 
+#ifdef GTK_DISABLE_DEPRECATED
+#undef GTK_DISABLE_DEPRECATED
+#endif
+
 #include <config.h>
 #include <string.h>
 #include <gdk/gdkkeysyms.h>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]