From: Ralf Habacker Date: Tue, 28 Apr 2015 18:11:27 +0000 (+0200) Subject: tools: MSVC compile fixes X-Git-Tag: dbus-1.9.16~33 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=20568ffb1fdcf54f54bc5d8b4928f3e485c5ab25;p=thirdparty%2Fdbus.git tools: MSVC compile fixes unistd.h and sleep() are normally Unix-specific, although mingw also provides them. The Windows C runtime documents _environ as its equivalent of Unix environ. https://bugs.freedesktop.org/show_bug.cgi?id=90089 Reviewed-by: Simon McVittie --- diff --git a/tools/dbus-echo.c b/tools/dbus-echo.c index 689c1b844..0e7de1bdd 100644 --- a/tools/dbus-echo.c +++ b/tools/dbus-echo.c @@ -26,7 +26,9 @@ #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif #include @@ -231,7 +233,7 @@ dbus_test_tool_black_hole (int argc, char **argv) if (noread) { while (1) - sleep (3600); + _dbus_sleep_milliseconds (3600); } noreply = TRUE; diff --git a/tools/dbus-update-activation-environment.c b/tools/dbus-update-activation-environment.c index 56d3b20d7..6c53d8e20 100644 --- a/tools/dbus-update-activation-environment.c +++ b/tools/dbus-update-activation-environment.c @@ -59,8 +59,14 @@ # define EX_OSERR 71 #endif -/* apparently this is the portable way to get the entire environment... */ +#ifdef DBUS_WIN +/* The Windows C runtime uses a different name */ +#define environ _environ +#else +/* apparently this is the portable way to get the entire environment... + * GNU platforms also put it in unistd.h but that's not portable */ extern char **environ; +#endif /* we don't really have anything useful to say about the stage at which we * failed */