diff --git a/configure.ac b/configure.ac index bc37b4bfe1..d78d5795ad 100644 --- a/configure.ac +++ b/configure.ac @@ -342,10 +342,6 @@ if test "x$HAVE_WINSOCK2_H" = "xyes"; then AC_SUBST(XDG_LIBS) fi -if test "x$HAVE_SYS_SOCKET_H" != "xyes"; then - AG_GST_DISABLE_PLUGIN(librfb) -fi - if test "x$HAVE_PTHREAD_H" = "xyes"; then DCCP_LIBS="$DCCP_LIBS -lpthread" AC_SUBST(DCCP_LIBS) diff --git a/gst/librfb/rfbdecoder.c b/gst/librfb/rfbdecoder.c index ee5da13351..28ca5c9e52 100644 --- a/gst/librfb/rfbdecoder.c +++ b/gst/librfb/rfbdecoder.c @@ -8,9 +8,13 @@ #include #include #include +#ifndef G_OS_WIN32 #include #include #include +#else +#include +#endif #include #include "vncauth.h" @@ -112,7 +116,11 @@ rfb_decoder_connect_tcp (RfbDecoder * decoder, gchar * addr, guint port) sa.sin_family = AF_INET; sa.sin_port = htons (port); +#ifndef G_OS_WIN32 inet_pton (AF_INET, addr, &sa.sin_addr); +#else + sa.sin_addr.s_addr = inet_addr (addr); +#endif if (connect (decoder->fd, (struct sockaddr *) &sa, sizeof (struct sockaddr)) == -1) { close (decoder->fd); @@ -164,7 +172,11 @@ rfb_decoder_read (RfbDecoder * decoder, guint32 len) } while (total < len) { +#ifndef G_OS_WIN32 now = recv (decoder->fd, decoder->data + total, len - total, 0); +#else + now = recv (decoder->fd, (char *) decoder->data + total, len - total, 0); +#endif if (now <= 0) { GST_WARNING ("rfb read error on socket"); return NULL; diff --git a/gst/librfb/vncauth.c b/gst/librfb/vncauth.c index 8771e1a2e1..d6ce7e4880 100644 --- a/gst/librfb/vncauth.c +++ b/gst/librfb/vncauth.c @@ -22,6 +22,7 @@ */ #include "config.h" +#include #include "_stdint.h" #include "stdio.h" #include "stdlib.h" @@ -130,10 +131,17 @@ vncRandomBytes (unsigned char *bytes) { int32_t i; uint32_t seed = (uint32_t) time (0); - +#ifndef G_OS_WIN32 srandom (seed); +#else + srand (seed); +#endif for (i = 0; i < CHALLENGESIZE; i++) { +#ifndef G_OS_WIN32 bytes[i] = (unsigned char) (random () & 255); +#else + bytes[i] = (unsigned char) (rand () & 255); +#endif } }