From 9a34caf40f41cf57a98af7391c42d78f09b4fe4b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 13 Jan 2020 15:42:27 -0800 Subject: [PATCH] GUACAMOLE-249: The FreeRDPConvertColor() function is also known as ConvertColor(), but was only available as ConvertColor() in older FreeRDP 2.0.0 release candidates. --- configure.ac | 16 +++++++++++++++- src/protocols/rdp/color.c | 5 +++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 928c4363..2f833244 100644 --- a/configure.ac +++ b/configure.ac @@ -541,7 +541,8 @@ AC_ARG_WITH([rdp], if test "x$with_rdp" != "xno" then have_freerdp2=yes - PKG_CHECK_MODULES([RDP], [freerdp2 freerdp-client2 winpr2],, + PKG_CHECK_MODULES([RDP], [freerdp2 freerdp-client2 winpr2], + [CPPFLAGS="${RDP_CFLAGS} $CPPFLAGS"], [AC_MSG_WARN([ -------------------------------------------- Unable to find FreeRDP (libfreerdp2 / libfreerdp-client2 / libwinpr2) @@ -550,6 +551,19 @@ then have_freerdp2=no]) fi +# Available color conversion functions +if test "x$have_freerdp2" = "xyes" +then + + # FreeRDP 2.0.0-rc3 and older referred to FreeRDPConvertColor() as + # ConvertColor() + AC_CHECK_DECL([FreeRDPConvertColor], + [AC_DEFINE([HAVE_FREERDPCONVERTCOLOR],, + [Whether FreeRDPConvertColor() is defined])],, + [#include ]) + +fi + AM_CONDITIONAL([ENABLE_RDP], [test "x${have_freerdp2}" = "xyes"]) # diff --git a/src/protocols/rdp/color.c b/src/protocols/rdp/color.c index ee7b7ce9..964310af 100644 --- a/src/protocols/rdp/color.c +++ b/src/protocols/rdp/color.c @@ -17,6 +17,7 @@ * under the License. */ +#include "config.h" #include "settings.h" #include @@ -59,8 +60,12 @@ UINT32 guac_rdp_convert_color(rdpContext* context, UINT32 color) { /* Convert color from RDP source format to the native format used by Cairo, * still maintaining intermediate representation */ +#ifdef HAVE_FREERDPCONVERTCOLOR intermed = FreeRDPConvertColor(intermed, src_format, dst_format, &gdi->palette); +#else + intermed = ConvertColor(intermed, src_format, dst_format, &gdi->palette); +#endif /* Convert color from intermediate representation to the actual desired * format */