src: simplify some conditionals related to features lacking on Windows

This avoids the need to probe for them prior to build.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-01-08 17:32:03 +00:00
parent c78adca86f
commit eb3641f347
3 changed files with 8 additions and 21 deletions

View File

@ -204,11 +204,6 @@ AS_IF([test "x$with_ovirt" = "xyes"],
)
AM_CONDITIONAL([HAVE_OVIRT], [test "x$with_ovirt" = "xyes"])
dnl Decide if this platform can support the SSH tunnel feature.
AC_CHECK_HEADERS([sys/socket.h sys/un.h windows.h])
AC_CHECK_FUNCS([fork socketpair])
if test "x$with_gtk_vnc" != "xyes" && test "x$with_spice_gtk" != "xyes"; then
AC_MSG_ERROR([At least one of spice or vnc must be used])
fi

View File

@ -39,17 +39,9 @@
#ifndef G_OS_WIN32
#include <glib-unix.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
#ifdef HAVE_WINDOWS_H
#else
#include <windows.h>
#endif
@ -768,7 +760,7 @@ virt_viewer_app_about_delete(GtkWidget *dialog,
gtk_widget_destroy(dialog);
}
#if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
#ifndef G_OS_WIN32
static int
virt_viewer_app_open_tunnel(const char **cmd)
@ -885,7 +877,7 @@ virt_viewer_app_open_unix_sock(const char *unixsock, GError **error)
return fd;
}
#endif /* defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK) */
#endif /* ! G_OS_WIN32 */
void
virt_viewer_app_trace(VirtViewerApp *self,
@ -1377,7 +1369,7 @@ virt_viewer_app_open_connection(VirtViewerApp *self, int *fd)
}
#if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
#ifndef G_OS_WIN32
static void
virt_viewer_app_channel_open(VirtViewerSession *session,
VirtViewerSessionChannel *channel,
@ -1448,7 +1440,7 @@ virt_viewer_app_default_activate(VirtViewerApp *self, GError **error)
g_debug("After open connection callback fd=%d", fd);
#if defined(HAVE_SOCKETPAIR) && defined(HAVE_FORK)
#ifndef G_OS_WIN32
if (priv->transport &&
g_ascii_strcasecmp(priv->transport, "ssh") == 0 &&
!priv->direct &&

View File

@ -42,7 +42,7 @@
#include <libxml/xpath.h>
#include <libxml/uri.h>
#if defined(HAVE_SOCKETPAIR)
#ifndef G_OS_WIN32
#include <sys/socket.h>
#endif
@ -681,7 +681,7 @@ virt_viewer_open_connection(VirtViewerApp *self G_GNUC_UNUSED, int *fd)
VirtViewer *viewer = VIRT_VIEWER(self);
VirtViewerPrivate *priv = viewer->priv;
virErrorPtr err;
#if defined(HAVE_SOCKETPAIR)
#ifndef G_OS_WIN32
int pair[2];
#endif
*fd = -1;
@ -699,7 +699,7 @@ virt_viewer_open_connection(VirtViewerApp *self G_GNUC_UNUSED, int *fd)
return TRUE;
}
#if defined(HAVE_SOCKETPAIR)
#ifndef G_OS_WIN32
if (socketpair(PF_UNIX, SOCK_STREAM, 0, pair) < 0)
return FALSE;