From d55a73f79b9dbbc12a957602fa01ef4b2abd08e5 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 19 Aug 2016 11:23:54 +0200 Subject: Remove unused functions from Windows builds Several internal functions are not used on Windows. This patch hides them behind DBUS_WIN. Signed-off-by: Thomas Zimmermann --- bus/config-parser.c | 35 +++-------------------------------- bus/dispatch.c | 5 +++++ 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/bus/config-parser.c b/bus/config-parser.c index 15d4228..df406f9 100644 --- a/bus/config-parser.c +++ b/bus/config-parser.c @@ -3523,20 +3523,13 @@ out: return ret; } +#ifndef DBUS_WIN static const char *test_system_service_dir_matches[] = { -#ifdef DBUS_UNIX "/usr/local/share/dbus-1/system-services", "/usr/share/dbus-1/system-services", -#endif DBUS_DATADIR"/dbus-1/system-services", -#ifdef DBUS_UNIX "/lib/dbus-1/system-services", -#endif - -#ifdef DBUS_WIN - NULL, -#endif NULL }; @@ -3546,9 +3539,6 @@ test_default_system_servicedirs (void) DBusList *dirs; DBusList *link; DBusString progs; -#ifndef DBUS_UNIX - const char *common_progs; -#endif int i; /* On Unix we don't actually use this variable, but it's easier to handle the @@ -3556,25 +3546,6 @@ test_default_system_servicedirs (void) if (!_dbus_string_init (&progs)) _dbus_assert_not_reached ("OOM allocating progs"); -#ifndef DBUS_UNIX - common_progs = _dbus_getenv ("CommonProgramFiles"); - - if (common_progs) - { - if (!_dbus_string_append (&progs, common_progs)) - { - _dbus_string_free (&progs); - return FALSE; - } - - if (!_dbus_string_append (&progs, "/dbus-1/system-services")) - { - _dbus_string_free (&progs); - return FALSE; - } - test_system_service_dir_matches[1] = _dbus_string_get_const_data(&progs); - } -#endif dirs = NULL; printf ("Testing retrieving the default system service directories\n"); @@ -3601,13 +3572,12 @@ test_default_system_servicedirs (void) _dbus_list_free_link (link); } -#ifdef DBUS_UNIX if (!dbus_setenv ("XDG_DATA_HOME", "/testhome/foo/.testlocal/testshare")) _dbus_assert_not_reached ("couldn't setenv XDG_DATA_HOME"); if (!dbus_setenv ("XDG_DATA_DIRS", ":/testusr/testlocal/testshare: :/testusr/testshare:")) _dbus_assert_not_reached ("couldn't setenv XDG_DATA_DIRS"); -#endif + if (!_dbus_get_standard_system_servicedirs (&dirs)) _dbus_assert_not_reached ("couldn't get stardard dirs"); @@ -3655,6 +3625,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) -- 2.7.4