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 */