[evolution-data-server/evolution-data-server-3-12] Misceallenous Win32 build related fixes



commit 6d7e950514f5473b1e59b6e122aee3566ed223d3
Author: Milan Crha <mcrha redhat com>
Date:   Sun Jun 1 21:08:59 2014 +0200

    Misceallenous Win32 build related fixes

 addressbook/libebook-contacts/e-book-query.c  |    6 ++++++
 camel/camel-file-utils.c                      |    2 ++
 camel/camel-sasl-ntlm.c                       |    2 +-
 camel/providers/imapx/camel-imapx-server.c    |    1 -
 camel/providers/imapx/camel-imapx-utils.c     |   23 +++++++----------------
 libedataserver/Makefile.am                    |    4 ++++
 libedataserver/e-alphabet-index-private.cpp   |    2 ++
 libedataserver/e-proxy.c                      |    1 +
 libedataserver/e-time-utils.c                 |    2 +-
 libedataserver/e-transliterator-private.cpp   |    2 ++
 tests/libebook-contacts/test-phone-number.c   |    5 +++++
 tests/libebook-contacts/test-query.c          |    5 +++++
 tests/libedata-book/data-test-utils.c         |   11 +++++++++++
 tests/test-server-utils/e-test-server-utils.c |   10 ++++++++++
 14 files changed, 57 insertions(+), 19 deletions(-)
---
diff --git a/addressbook/libebook-contacts/e-book-query.c b/addressbook/libebook-contacts/e-book-query.c
index 419255a..ba0387f 100644
--- a/addressbook/libebook-contacts/e-book-query.c
+++ b/addressbook/libebook-contacts/e-book-query.c
@@ -42,6 +42,12 @@
 
 #include <libedataserver/libedataserver.h>
 
+#ifdef G_OS_WIN32
+#ifndef LC_MESSAGES
+#define LC_MESSAGES LC_CTYPE
+#endif
+#endif
+
 typedef enum {
        E_BOOK_QUERY_TYPE_AND,
        E_BOOK_QUERY_TYPE_OR,
diff --git a/camel/camel-file-utils.c b/camel/camel-file-utils.c
index 22c800e..8793827 100644
--- a/camel/camel-file-utils.c
+++ b/camel/camel-file-utils.c
@@ -40,8 +40,10 @@
 
 #ifdef G_OS_WIN32
 #include <winsock2.h>
+#ifndef EWOULDBLOCK
 #define EWOULDBLOCK EAGAIN
 #endif
+#endif
 
 #define IO_TIMEOUT (60*4)
 
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
index f97acc3..8db471a 100644
--- a/camel/camel-sasl-ntlm.c
+++ b/camel/camel-sasl-ntlm.c
@@ -807,10 +807,10 @@ sasl_ntlm_challenge_sync (CamelSasl *sasl,
 
        ret = g_byte_array_new ();
 
+#ifndef G_OS_WIN32
        if (!priv->tried_helper && password == NULL)
                sasl_ntlm_try_empty_password_sync (sasl, cancellable, NULL);
 
-#ifndef G_OS_WIN32
        if (priv->helper_stream && password == NULL) {
                guchar *data;
                gsize length = 0;
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 4a103bb..1d8b629 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -30,7 +30,6 @@
 #include <fcntl.h>
 #include <time.h>
 #include <unistd.h>
-#include <sys/ioctl.h>
 #include <sys/types.h>
 #include <glib/gstdio.h>
 #include <glib/gi18n-lib.h>
diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c
index e802f41..1232f8b 100644
--- a/camel/providers/imapx/camel-imapx-utils.c
+++ b/camel/providers/imapx/camel-imapx-utils.c
@@ -15,12 +15,14 @@
  * along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <ctype.h>
 #include <errno.h>
 #include <string.h>
 
-#include <gio/gunixoutputstream.h>
-
 #include "camel-imapx-command.h"
 #include "camel-imapx-folder.h"
 #include "camel-imapx-settings.h"
@@ -1540,7 +1542,6 @@ imapx_free_fetch (struct _fetch_info *finfo)
 void
 imapx_dump_fetch (struct _fetch_info *finfo)
 {
-       GOutputStream *output_stream;
        gconstpointer data;
        gsize size;
 
@@ -1550,8 +1551,6 @@ imapx_dump_fetch (struct _fetch_info *finfo)
                return;
        }
 
-       output_stream = g_unix_output_stream_new (STDOUT_FILENO, FALSE);
-
        /* XXX g_output_stream_write_bytes_all() would be awfully
         *     handy here.  g_output_stream_write_bytes() may not
         *     write the entire GBytes. */
@@ -1559,25 +1558,19 @@ imapx_dump_fetch (struct _fetch_info *finfo)
        if (finfo->body != NULL) {
                g_print ("Body content:\n");
                data = g_bytes_get_data (finfo->body, &size);
-               g_output_stream_write_all (
-                       output_stream, data,
-                       size, NULL, NULL, NULL);
+               fwrite (data, size, 1, stdout);
        }
 
        if (finfo->text != NULL) {
                g_print ("Text content:\n");
                data = g_bytes_get_data (finfo->text, &size);
-               g_output_stream_write_all (
-                       output_stream, data,
-                       size, NULL, NULL, NULL);
+               fwrite (data, size, 1, stdout);
        }
 
        if (finfo->header != NULL) {
                g_print ("Header content:\n");
                data = g_bytes_get_data (finfo->header, &size);
-               g_output_stream_write_all (
-                       output_stream, data,
-                       size, NULL, NULL, NULL);
+               fwrite (data, size, 1, stdout);
        }
 
        if (finfo->minfo != NULL) {
@@ -1602,8 +1595,6 @@ imapx_dump_fetch (struct _fetch_info *finfo)
 
        if (finfo->uid != NULL)
                g_print ("UID: '%s'\n", finfo->uid);
-
-       g_object_unref (output_stream);
 }
 
 static gboolean
diff --git a/libedataserver/Makefile.am b/libedataserver/Makefile.am
index 0391f83..18b6dd8 100644
--- a/libedataserver/Makefile.am
+++ b/libedataserver/Makefile.am
@@ -186,7 +186,11 @@ libedataserver_private_la_SOURCES = \
        e-transliterator-private.cpp \
        $(NULL)
 libedataserver_private_la_CPPFLAGS = $(libedataserver_1_2_la_CPPFLAGS)
+if OS_WIN32
+libedataserver_1_2_la_LIBADD += libedataserver-private.la -lstdc++
+else
 libedataserver_1_2_la_LIBADD += @predeps_CXX@ libedataserver-private.la @postdeps_CXX@
+endif
 
 %-$(API_VERSION).pc: %.pc
         cp $< $@
diff --git a/libedataserver/e-alphabet-index-private.cpp b/libedataserver/e-alphabet-index-private.cpp
index f8d66ea..f16fde9 100644
--- a/libedataserver/e-alphabet-index-private.cpp
+++ b/libedataserver/e-alphabet-index-private.cpp
@@ -28,7 +28,9 @@
 #include <memory>
 
 /* system headers */
+#ifdef HAVE_CODESET
 #include <langinfo.h>
+#endif
 #include <locale.h>
 
 /* ICU headers */
diff --git a/libedataserver/e-proxy.c b/libedataserver/e-proxy.c
index 7f64c0d..9ada565 100644
--- a/libedataserver/e-proxy.c
+++ b/libedataserver/e-proxy.c
@@ -29,6 +29,7 @@
 
 #ifdef _WIN32
 #include <winsock2.h>
+#include <ws2tcpip.h>
 #ifndef IN6_ARE_ADDR_EQUAL
 #define IN6_ARE_ADDR_EQUAL(a, b) \
     (memcmp ((gpointer)(a), (gpointer)(b), sizeof (struct in6_addr)) == 0)
diff --git a/libedataserver/e-time-utils.c b/libedataserver/e-time-utils.c
index d5ce27a..75acacf 100644
--- a/libedataserver/e-time-utils.c
+++ b/libedataserver/e-time-utils.c
@@ -943,7 +943,7 @@ __strptime_internal (rp,
              const gchar *picture;
              const gchar *posix_t_fmt;
 
-             picture = get_local_string (LOCALE_STIMEFORMAT);
+             picture = get_locale_string (LOCALE_STIMEFORMAT);
              posix_t_fmt = translate_picture (picture);
 
              if (!recursive (posix_t_fmt))
diff --git a/libedataserver/e-transliterator-private.cpp b/libedataserver/e-transliterator-private.cpp
index f777a0f..5b8c200 100644
--- a/libedataserver/e-transliterator-private.cpp
+++ b/libedataserver/e-transliterator-private.cpp
@@ -28,7 +28,9 @@
 #include <memory>
 
 /* system headers */
+#ifdef HAVE_CODESET
 #include <langinfo.h>
+#endif
 #include <locale.h>
 
 /* ICU headers */
diff --git a/tests/libebook-contacts/test-phone-number.c b/tests/libebook-contacts/test-phone-number.c
index 886c9eb..47b61a9 100644
--- a/tests/libebook-contacts/test-phone-number.c
+++ b/tests/libebook-contacts/test-phone-number.c
@@ -30,6 +30,11 @@
 #define CATEGORY LC_ADDRESS
 #else
 /* Mimic the fallback branch in EBookQuery. */
+#ifdef G_OS_WIN32
+#ifndef LC_MESSAGES
+#define LC_MESSAGES LC_CTYPE
+#endif
+#endif
 #define CATEGORY LC_MESSAGES
 #endif /* LC_ADDRESS */
 
diff --git a/tests/libebook-contacts/test-query.c b/tests/libebook-contacts/test-query.c
index 2453401..c44e035 100644
--- a/tests/libebook-contacts/test-query.c
+++ b/tests/libebook-contacts/test-query.c
@@ -12,6 +12,11 @@
 #define CATEGORY LC_ADDRESS
 #else
 /* Mimic the fallback branch in EBookQuery. */
+#ifdef G_OS_WIN32
+#ifndef LC_MESSAGES
+#define LC_MESSAGES LC_CTYPE
+#endif
+#endif
 #define CATEGORY LC_MESSAGES
 #endif /* LC_ADDRESS */
 
diff --git a/tests/libedata-book/data-test-utils.c b/tests/libedata-book/data-test-utils.c
index 46179d4..da99188 100644
--- a/tests/libedata-book/data-test-utils.c
+++ b/tests/libedata-book/data-test-utils.c
@@ -17,7 +17,14 @@
  * Authors: Tristan Van Berkom <tristanvb openismus com>
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif
+
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -116,8 +123,12 @@ delete_work_directory (const gchar *filename)
                                        NULL, NULL, &exit_status, NULL);
 
        g_assert (spawn_succeeded);
+       #ifndef G_OS_WIN32
        g_assert (WIFEXITED (exit_status));
        g_assert_cmpint (WEXITSTATUS (exit_status), ==, 0);
+       #else
+       g_assert_cmpint (exit_status, ==, 0);
+       #endif
 }
 
 ESourceBackendSummarySetup *
diff --git a/tests/test-server-utils/e-test-server-utils.c b/tests/test-server-utils/e-test-server-utils.c
index 71cfe81..47d5d61 100644
--- a/tests/test-server-utils/e-test-server-utils.c
+++ b/tests/test-server-utils/e-test-server-utils.c
@@ -34,9 +34,15 @@
  * and e_test_server_utils_teardown() in thier fixture's setup and teardown routines.
  **/
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include "e-test-server-utils.h"
 
+#ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
+#endif
 
 #define ADDRESS_BOOK_SOURCE_UID "test-address-book"
 #define CALENDAR_SOURCE_UID     "test-calendar"
@@ -274,8 +280,12 @@ delete_work_directory (void)
                                        NULL, NULL, &exit_status, NULL);
 
        g_assert (spawn_succeeded);
+       #ifndef G_OS_WIN32
        g_assert (WIFEXITED (exit_status));
        g_assert_cmpint (WEXITSTATUS (exit_status), ==, 0);
+       #else
+       g_assert_cmpint (exit_status, ==, 0);
+       #endif
 }
 
 static gboolean


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