From d3edbfad29f7b73cd81d52a44272b9ec6d3a96aa Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 19 Aug 2016 11:23:54 +0200 Subject: Minor fixes for Windows builds This patch fixes several incorrect function prototypes and unused fucntions on Windows. In one place, string.h is now included. Signed-off-by: Thomas Zimmermann --- bus/config-parser.c | 2 ++ bus/dispatch.c | 5 +++++ dbus/dbus-sysdeps-win.c | 12 +++++++----- dbus/dbus-test-main.c | 1 + test/manual-paths.c | 4 ++-- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/bus/config-parser.c b/bus/config-parser.c index 15d4228..a6f6104 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -3523,6 +3523,7 @@ out: return ret; } +#ifndef DBUS_WIN static const char *test_system_service_dir_matches[] = { #ifdef DBUS_UNIX @@ -3655,6 +3656,7 @@ test_default_system_servicedirs (void) _dbus_string_free (&progs); return TRUE; } +#endif dbus_bool_t bus_config_parser_test (const DBusString *test_data_dir) diff --git a/bus/dispatch.c b/bus/dispatch.c index 9a6eaaf..284c590 100644 --- a/bus/dispatch.c +++ b/bus/dispatch.c @@ -3698,6 +3698,8 @@ check_launch_service_file_missing (BusContext *context, return retval; } +#ifndef DBUS_WIN + #define SERVICE_USER_MISSING_NAME "org.freedesktop.DBus.TestSuiteNoUser" /* returns TRUE if the correct thing happens, @@ -4001,6 +4003,7 @@ check_launch_service_service_missing (BusContext *context, return retval; } +#endif #define SHELL_FAIL_SERVICE_NAME "org.freedesktop.DBus.TestSuiteShellEchoServiceFail" @@ -4952,6 +4955,7 @@ bus_dispatch_test_conf (const DBusString *test_data_dir, return TRUE; } +#ifndef DBUS_WIN static dbus_bool_t bus_dispatch_test_conf_fail (const DBusString *test_data_dir, const char *filename) @@ -5008,6 +5012,7 @@ bus_dispatch_test_conf_fail (const DBusString *test_data_dir, return TRUE; } +#endif dbus_bool_t bus_dispatch_test (const DBusString *test_data_dir) diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index 32b49b8..a9b3ca3 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -99,7 +99,7 @@ _dbus_win_set_errno (int err) #endif } -static BOOL is_winxp_sp3_or_lower(); +static BOOL is_winxp_sp3_or_lower(void); /* * _MIB_TCPROW_EX and friends are not available in system headers @@ -631,12 +631,12 @@ _dbus_write_socket_two (DBusSocket fd, { DBUS_SOCKET_SET_ERRNO (); _dbus_verbose ("WSASend: failed: %s\n", _dbus_strerror_from_errno ()); - bytes_written = -1; + bytes_written = (DWORD)-1; } else _dbus_verbose ("WSASend: = %ld\n", bytes_written); - if (bytes_written < 0 && errno == EINTR) + if (bytes_written == (DWORD)-1 && errno == EINTR) goto again; return bytes_written; @@ -941,7 +941,7 @@ _dbus_pid_for_log (void) #ifndef DBUS_WINCE -static BOOL is_winxp_sp3_or_lower() +static BOOL is_winxp_sp3_or_lower(void) { OSVERSIONINFOEX osvi; DWORDLONG dwlConditionMask = 0; @@ -1315,9 +1315,11 @@ _dbus_poll (DBusPollFD *fds, #else /* USE_CHRIS_IMPL */ +#ifdef DBUS_ENABLE_VERBOSE_MODE #define DBUS_POLL_CHAR_BUFFER_SIZE 2000 char msg[DBUS_POLL_CHAR_BUFFER_SIZE]; char *msgp; +#endif fd_set read_set, write_set, err_set; SOCKET max_fd = 0; @@ -2550,7 +2552,7 @@ static DWORD WINAPI dump_thread_proc (LPVOID lpParameter) /* cannot get valid context from current thread, so we have to execute * backtrace from another thread */ -static void dump_backtrace () +static void dump_backtrace (void) { HANDLE hCurrentThread; HANDLE hThread; diff --git a/dbus/dbus-test-main.c b/dbus/dbus-test-main.c index 08e402b..f8088f8 100644 --- a/dbus/dbus-test-main.c +++ b/dbus/dbus-test-main.c @@ -27,6 +27,7 @@ #include "dbus-test.h" #include #include +#include #if HAVE_LOCALE_H #include #endif diff --git a/test/manual-paths.c b/test/manual-paths.c index c86ed6b..708f6b4 100644 --- a/test/manual-paths.c +++ b/test/manual-paths.c @@ -12,7 +12,7 @@ #include -static dbus_bool_t print_install_root() +static dbus_bool_t print_install_root(void) { DBusString runtime_prefix; @@ -42,7 +42,7 @@ static dbus_bool_t print_install_root() return TRUE; } -static dbus_bool_t print_service_dirs() +static dbus_bool_t print_service_dirs(void) { DBusList *dirs; DBusList *link; -- 2.7.4