Miscellaneous build fixes for Windows
authorFridrich Štrba <fridrich.strba@bluewin.ch>
Mon, 7 Mar 2011 10:06:27 +0000 (11:06 +0100)
committerFridrich Štrba <fridrich.strba@bluewin.ch>
Mon, 7 Mar 2011 10:06:27 +0000 (11:06 +0100)
Conflicts:

camel/providers/local/camel-maildir-store.c
camel/providers/local/camel-maildir-summary.c
camel/providers/local/camel-mh-store.c

camel/camel-sasl-gssapi.c
camel/providers/local/Makefile.am
camel/providers/local/camel-maildir-store.c
camel/providers/local/camel-maildir-summary.c
camel/providers/local/camel-mh-store.c
libedataserverui/e-name-selector-dialog.c

index cb59919..fac8c83 100644 (file)
 #include <string.h>
 #include <sys/types.h>
 
+#ifndef _WIN32
+#include <netdb.h>
+#include <sys/socket.h>
+#endif
+
 #include <gio/gio.h>
 #include <glib/gi18n-lib.h>
 
index 3f7bc7a..cb52ac9 100644 (file)
@@ -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 =                               \
index fa1675e..d0441d7 100644 (file)
@@ -179,12 +179,12 @@ maildir_store_get_folder_sync (CamelStore *store,
 
        if (!g_ascii_strcasecmp (folder_name, "Inbox")) {
                /* special case "." (aka inbox), may need to be created */
-               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_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 (g_mkdir (tmp, 0700) != 0
+                           || g_mkdir (cur, 0700) != 0
+                           || g_mkdir (new, 0700) != 0) {
                                g_set_error (
                                        error, G_IO_ERROR,
                                        g_io_error_from_errno (errno),
@@ -212,10 +212,10 @@ maildir_store_get_folder_sync (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 (name, 0700) != 0
+                           || g_mkdir (tmp, 0700) != 0
+                           || g_mkdir (cur, 0700) != 0
+                           || g_mkdir (new, 0700) != 0) {
                                g_set_error (
                                        error, G_IO_ERROR,
                                        g_io_error_from_errno (errno),
@@ -323,10 +323,10 @@ maildir_store_delete_folder_sync (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 (name, 0700);
+                       g_mkdir (cur, 0700);
+                       g_mkdir (new, 0700);
+                       g_mkdir (tmp, 0700);
                        g_set_error (
                                error, G_IO_ERROR,
                                g_io_error_from_errno (err),
index b116cd5..972d203 100644 (file)
 #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>
@@ -370,7 +374,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);
index 7fb31f8..fdc324b 100644 (file)
@@ -476,7 +476,7 @@ mh_store_get_folder_sync (CamelStore *store,
                        return NULL;
                }
 
-               if (mkdir (name, 0777) != 0) {
+               if (g_mkdir (name, 0777) != 0) {
                        g_set_error (
                                error, G_IO_ERROR,
                                g_io_error_from_errno (errno),
index 9e27124..8376bcb 100644 (file)
  * 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>