I tried to cross-compile wfreerdp on my Linux box with a recent
Mingw-w64 release (Mingw-w64 2.0, gcc 4.7) and found some minor issues
which I think can be fixed for the next release of FreeRDP as they are
mostly related to the case sensitive behavior on Linux when include
files are specified. 
With this patch Freerdp-1.0.0 builds correctly (although with some
compiler warnings) and the resulting wfreerdp.exe at least shows the
login screen of one of my terminal servers. I've concluded from the
discussions on the list and from the bugtracker that wfreerdp at the
moment is not really considered functional. Is this correct?  


Index: include/freerdp/types.h
==================================================================
--- include/freerdp/types.h
+++ include/freerdp/types.h
@@ -20,11 +20,11 @@
 
 #ifndef __RDP_TYPES_H
 #define __RDP_TYPES_H
 
 #ifdef _WIN32
-#include <WinDef.h>
+#include <windef.h>
 #endif
 
 /* Base Types */
 
 #ifdef HAVE_LIMITS_H
@@ -66,11 +66,12 @@
 #endif /* HAVE_INTTYPES_H */
 
 #ifdef HAVE_STDBOOL_H
 
 #include <stdbool.h>
-typedef int boolean;
+typedef unsigned char boolean;
+
 
 #else
 
 #ifndef __cplusplus
 

Index: include/freerdp/window.h
==================================================================
--- include/freerdp/window.h
+++ include/freerdp/window.h
@@ -21,11 +21,11 @@
 #define __UPDATE_WINDOW_H
 
 #include <freerdp/types.h>
 
 #ifdef _WIN32
-#include <Windows.h>
+#include <windows.h>
 #endif
 
 /* Window Order Header Flags */
 #define WINDOW_ORDER_TYPE_WINDOW                       0x01000000
 #define WINDOW_ORDER_TYPE_NOTIFY                       0x02000000

Index: libfreerdp-core/listener.c
==================================================================
--- libfreerdp-core/listener.c
+++ libfreerdp-core/listener.c
@@ -168,13 +168,20 @@
        {
                peer_addr_size = sizeof(peer_addr);
                peer_sockfd = accept(listener->sockfds[i], (struct sockaddr
*)&peer_addr, &peer_addr_size);
                if (peer_sockfd == -1)
                {
+#ifdef _WIN32
+                       int wsa_error = WSAGetLastError();
+
+                       /* No data available */
+                       if (wsa_error == WSAEWOULDBLOCK)
+                          continue;
+#else
                        if (errno == EAGAIN || errno == EWOULDBLOCK)
                                continue;
-
+#endif
                        perror("accept");
                        return false;
                }
 
                client = freerdp_peer_new(peer_sockfd);

Index: libfreerdp-core/tcp.c
==================================================================
--- libfreerdp-core/tcp.c
+++ libfreerdp-core/tcp.c
@@ -218,14 +218,24 @@
 
        status = send(tcp->sockfd, data, length, MSG_NOSIGNAL);
 
        if (status < 0)
        {
+#ifdef _WIN32
+               int wsa_error = WSAGetLastError();
+
+               /* No data available */
+               if (wsa_error == WSAEWOULDBLOCK)
+                       status = 0;
+                else 
+                        perror("send");
+#else
                if (errno == EAGAIN || errno == EWOULDBLOCK)
                        status = 0;
                else
                        perror("send");
+#endif
        }
 
        return status;
 }
 

Index: libfreerdp-core/tcp.h
==================================================================
--- libfreerdp-core/tcp.h
+++ libfreerdp-core/tcp.h
@@ -21,11 +21,11 @@
 #ifndef __TCP_H
 #define __TCP_H
 
 #ifdef _WIN32
 #include <winsock2.h>
-#include <Windows.h>
+#include <windows.h>
 #include <ws2tcpip.h>
 #endif
 
 #include <freerdp/types.h>
 #include <freerdp/settings.h>

Index: libfreerdp-utils/pcap.c
==================================================================
--- libfreerdp-utils/pcap.c
+++ libfreerdp-utils/pcap.c
@@ -24,15 +24,17 @@
 #include <sys/time.h>
 #else
 #include <time.h>
 #include <sys/timeb.h>
 
+#if !defined(__MINGW32__) && !defined(__MINGW64__)
 struct timeval
 {
        long tv_sec;
        long tv_usec;
 };
+#endif
 
 int gettimeofday(struct timeval* tp, void* tz)
 {
        struct _timeb timebuffer;
        _ftime (&timebuffer);

Index: libfreerdp-utils/thread.c
==================================================================
--- libfreerdp-utils/thread.c
+++ libfreerdp-utils/thread.c
@@ -21,11 +21,11 @@
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
 
 #ifdef _WIN32
-#include <Windows.h>
+#include <windows.h>
 #ifdef _MSC_VER
 #include <process.h>
 #endif
 #endif
   


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Freerdp-devel mailing list
Freerdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to