From 23ee6f5fdd7f5fbb151a12f35599172397755fc5 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Wed, 14 Apr 2010 03:20:44 +0200 Subject: [PATCH 4/4] Fix warnings on Windows CE target. --- cmake/ConfigureChecks.cmake | 1 + cmake/config.h.cmake | 3 +++ configure.in | 2 ++ dbus/dbus-sysdeps-win.c | 5 +++++ dbus/dbus-sysdeps-wince-glue.h | 4 +++- 5 files changed, 14 insertions(+), 1 deletions(-) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 5c405a8..4b9fbd1 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -10,6 +10,7 @@ check_include_file(sys/poll.h HAVE_POLL) # dbus-sysdeps.c, dbus-sysdeps-w check_include_file(sys/time.h HAVE_SYS_TIME_H)# dbus-sysdeps-win.c check_include_file(sys/wait.h HAVE_SYS_WAIT_H)# dbus-sysdeps-win.c check_include_file(time.h HAVE_TIME_H) # dbus-sysdeps-win.c +check_include_file(ws2tcpip.h HAVE_WS2TCPIP_H)# dbus-sysdeps-win.c check_include_file(wspiapi.h HAVE_WSPIAPI_H) # dbus-sysdeps-win.c check_include_file(unistd.h HAVE_UNISTD_H) # dbus-sysdeps-util-win.c check_include_file(stdio.h HAVE_STDIO_H) # dbus-sysdeps.h diff --git a/cmake/config.h.cmake b/cmake/config.h.cmake index 9083eb4..072dbdf 100644 --- a/cmake/config.h.cmake +++ b/cmake/config.h.cmake @@ -119,6 +119,9 @@ /* Define to 1 if you have time.h */ #cmakedefine HAVE_TIME_H 1 +/* Define to 1 if you have ws2tcpip.h */ +#cmakedefine HAVE_WS2TCPIP_H + /* Define to 1 if you have wspiapi.h */ #cmakedefine HAVE_WSPIAPI_H 1 diff --git a/configure.in b/configure.in index b495460..8fce903 100644 --- a/configure.in +++ b/configure.in @@ -533,6 +533,8 @@ AC_CHECK_HEADERS(byteswap.h) AC_CHECK_HEADERS(unistd.h) +AC_CHECK_HEADERS(ws2tcpip.h) + AC_CHECK_HEADERS(wspiapi.h) # Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index bcb9c82..16c6f69 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -69,6 +69,11 @@ extern BOOL WINAPI ConvertSidToStringSidA (PSID Sid, LPSTR *StringSid); #include #endif +#ifdef HAVE_WS2TCPIP_H +/* getaddrinfo for Windows CE (and Windows). */ +#include +#endif + #ifdef HAVE_WSPIAPI_H // needed for w2k compatibility (getaddrinfo/freeaddrinfo/getnameinfo) #ifdef __GNUC__ diff --git a/dbus/dbus-sysdeps-wince-glue.h b/dbus/dbus-sysdeps-wince-glue.h index 47f13da..6d8e3b1 100644 --- a/dbus/dbus-sysdeps-wince-glue.h +++ b/dbus/dbus-sysdeps-wince-glue.h @@ -28,6 +28,8 @@ #include #include +/* For getaddrinfo. */ +#define _WIN32_WCE 0x0401 #include #undef interface @@ -46,7 +48,7 @@ BOOL WINAPI SHGetSpecialFolderPathW(HWND,LPWSTR,int,BOOL); /* Seriously. Windows CE does not have errno. Don't you hate it when that happens? */ -#define errno (GetLastError ()) +#define errno ((int)GetLastError ()) #define ENOENT ERROR_FILE_NOT_FOUND #define EMFILE ERROR_TOO_MANY_OPEN_FILES -- 1.7.0.4