[evolution-data-server] Misceallenous Win32 build related fixes
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Misceallenous Win32 build related fixes
- Date: Sun, 1 Jun 2014 19:09:53 +0000 (UTC)
commit 29069bce08f9986096710cc502584bb073064efe
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 f1dea2e..54bafc3 100644
--- a/addressbook/libebook-contacts/e-book-query.c
+++ b/addressbook/libebook-contacts/e-book-query.c
@@ -41,6 +41,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 e38fd10..af5f33c 100644
--- a/camel/camel-file-utils.c
+++ b/camel/camel-file-utils.c
@@ -39,8 +39,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 698d579..fdc4fa0 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 e098827..0399dbd 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -31,7 +31,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 2d3d430..060bf68 100644
--- a/camel/providers/imapx/camel-imapx-utils.c
+++ b/camel/providers/imapx/camel-imapx-utils.c
@@ -16,12 +16,14 @@
*
*/
+#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"
@@ -1541,7 +1543,6 @@ imapx_free_fetch (struct _fetch_info *finfo)
void
imapx_dump_fetch (struct _fetch_info *finfo)
{
- GOutputStream *output_stream;
gconstpointer data;
gsize size;
@@ -1551,8 +1552,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. */
@@ -1560,25 +1559,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) {
@@ -1603,8 +1596,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 e831188..9b73d96 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 9639f3a..25afcf8 100644
--- a/libedataserver/e-proxy.c
+++ b/libedataserver/e-proxy.c
@@ -26,6 +26,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 c8dfe6e..24e4202 100644
--- a/libedataserver/e-time-utils.c
+++ b/libedataserver/e-time-utils.c
@@ -953,7 +953,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 980db70..f06ba2c 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 7f9d191..fb4dcbc 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 943071c..d76f25e 100644
--- a/tests/libebook-contacts/test-query.c
+++ b/tests/libebook-contacts/test-query.c
@@ -27,6 +27,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 f3adb7b..c175d36 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 ee6be3e..7417da1 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]