From 17df42e4b546fe8caac2bdbf92ecf4a8fad98cb1 Mon Sep 17 00:00:00 2001 From: Petr Sumbera Date: Mon, 2 Feb 2015 08:48:54 -0800 Subject: [PATCH] Fixes some build issues on Solaris 11. --- channels/drive/client/drive_file.c | 4 ++-- libfreerdp/core/tcp.c | 2 ++ server/shadow/shadow_server.c | 2 +- winpr/libwinpr/crt/string.c | 4 +--- winpr/libwinpr/synch/wait.c | 3 ++- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/channels/drive/client/drive_file.c b/channels/drive/client/drive_file.c index 5f3aa4718..01bd79f4f 100644 --- a/channels/drive/client/drive_file.c +++ b/channels/drive/client/drive_file.c @@ -487,7 +487,7 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN int status; char* fullpath; struct STAT st; -#if defined(__linux__) && !defined(ANDROID) +#if defined(__linux__) && !defined(ANDROID) || defined(sun) struct timespec tv[2]; #else struct timeval tv[2]; @@ -519,7 +519,7 @@ BOOL drive_file_set_information(DRIVE_FILE* file, UINT32 FsInformationClass, UIN tv[0].tv_usec = 0; tv[1].tv_usec = 0; utimes(file->fullpath, tv); -#elif defined (__linux__) +#elif defined (__linux__) || defined (sun) tv[0].tv_nsec = 0; tv[1].tv_nsec = 0; futimens(file->fd, tv); diff --git a/libfreerdp/core/tcp.c b/libfreerdp/core/tcp.c index c890356f4..a7f141d64 100644 --- a/libfreerdp/core/tcp.c +++ b/libfreerdp/core/tcp.c @@ -51,6 +51,8 @@ #include #endif +#include + #ifdef __FreeBSD__ #ifndef SOL_TCP #define SOL_TCP IPPROTO_TCP diff --git a/server/shadow/shadow_server.c b/server/shadow/shadow_server.c index 48b0192ed..a0c560a19 100644 --- a/server/shadow/shadow_server.c +++ b/server/shadow/shadow_server.c @@ -34,7 +34,7 @@ #ifndef _WIN32 #include -#include +#include #endif #include "shadow.h" diff --git a/winpr/libwinpr/crt/string.c b/winpr/libwinpr/crt/string.c index 0fca34cdf..776167f39 100644 --- a/winpr/libwinpr/crt/string.c +++ b/winpr/libwinpr/crt/string.c @@ -57,9 +57,7 @@ WCHAR* _wcsdup(const WCHAR* strSource) if (strSource == NULL) return NULL; -#if defined(sun) && sun - strDestination = wsdup(strSource); -#elif defined(__APPLE__) && defined(__MACH__) || defined(ANDROID) +#if defined(__APPLE__) && defined(__MACH__) || defined(ANDROID) || defined(sun) strDestination = malloc(wcslen((wchar_t*)strSource)); if (strDestination != NULL) diff --git a/winpr/libwinpr/synch/wait.c b/winpr/libwinpr/synch/wait.c index 73de29a6e..60918e398 100644 --- a/winpr/libwinpr/synch/wait.c +++ b/winpr/libwinpr/synch/wait.c @@ -61,6 +61,7 @@ #ifndef _WIN32 +#include #include #include #include @@ -108,7 +109,7 @@ static long long ts_difftime(const struct timespec *o, #if !defined(HAVE_PTHREAD_GNU_EXT) #include -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(sun) /*the only way to get it work is to remove the static*/ int pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *timeout) #else