wfreerdp: fix mingw64 cross-compilation (Felix Wolfheimer)
This commit is contained in:
parent
04039da49a
commit
005ffa0bb0
@ -22,7 +22,7 @@
|
||||
#define __RDP_TYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <WinDef.h>
|
||||
#include <windef.h>
|
||||
#endif
|
||||
|
||||
/* Base Types */
|
||||
@ -68,7 +68,8 @@ typedef signed long long sint64;
|
||||
#ifdef HAVE_STDBOOL_H
|
||||
|
||||
#include <stdbool.h>
|
||||
typedef int boolean;
|
||||
typedef unsigned char boolean;
|
||||
|
||||
|
||||
#else
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <freerdp/types.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
/* Window Order Header Flags */
|
||||
|
@ -168,11 +168,19 @@ static boolean freerdp_listener_check_fds(freerdp_listener* instance)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
@ -220,10 +220,20 @@ int tcp_write(rdpTcp* tcp, uint8* data, int length)
|
||||
|
||||
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;
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
|
@ -26,11 +26,13 @@
|
||||
#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)
|
||||
{
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <time.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
#include <windows.h>
|
||||
#ifdef _MSC_VER
|
||||
#include <process.h>
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user