diff options
author | Hardening <rdp.effort@gmail.com> | 2014-01-10 11:33:06 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-01-19 22:35:51 -0800 |
commit | 04633b69324ef1df086f1f2a2686441937575ccf (patch) | |
tree | b5ed00e9fec643a97d64c4e908e20907009d89e3 | |
parent | ac9f35a72b592426809c5698caf9f2c2b55b5ec8 (diff) | |
download | weston-04633b69324ef1df086f1f2a2686441937575ccf.tar.gz weston-04633b69324ef1df086f1f2a2686441937575ccf.tar.bz2 weston-04633b69324ef1df086f1f2a2686441937575ccf.zip |
Fix compilation with FreeRdp 1.1 and master v2
The API to use remoteFx encoding has changed between master and stable 1.1
branch. This patch should fix compilation for both.
This new version adds checks for the freerdp/version.h file
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | src/compositor-rdp.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 571bf601..d66dbec8 100644 --- a/configure.ac +++ b/configure.ac @@ -204,6 +204,11 @@ AM_CONDITIONAL([ENABLE_RDP_COMPOSITOR], if test x$enable_rdp_compositor = xyes; then AC_DEFINE([BUILD_RDP_COMPOSITOR], [1], [Build the RDP compositor]) PKG_CHECK_MODULES(RDP_COMPOSITOR, [freerdp >= 1.1.0]) + + SAVED_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $RDP_COMPOSITOR_CFLAGS" + AC_CHECK_HEADERS([freerdp/version.h]) + CPPFLAGS="$SAVED_CPPFLAGS" fi AC_ARG_WITH(cairo, diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c index b9c36cfd..e8e4a8dc 100644 --- a/src/compositor-rdp.c +++ b/src/compositor-rdp.c @@ -27,6 +27,14 @@ #include <errno.h> #include <linux/input.h> +#if HAVE_FREERDP_VERSION_H +#include <freerdp/version.h> +#else +/* assume it's a early 1.1 version */ +#define FREERDP_VERSION_MAJOR 1 +#define FREERDP_VERSION_MINOR 1 +#endif + #include <freerdp/freerdp.h> #include <freerdp/listener.h> #include <freerdp/update.h> @@ -571,7 +579,11 @@ rdp_peer_context_new(freerdp_peer* client, RdpPeerContext* context) context->item.peer = client; context->item.flags = RDP_PEER_OUTPUT_ENABLED; +#if FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR == 1 context->rfx_context = rfx_context_new(); +#else + context->rfx_context = rfx_context_new(TRUE); +#endif context->rfx_context->mode = RLGR3; context->rfx_context->width = client->settings->DesktopWidth; context->rfx_context->height = client->settings->DesktopHeight; |