Test for SetDefault and SetNull before using them (not present in FreeRDP 1.0.1), fix naming conflict with default pointer setting functions.

This commit is contained in:
Michael Jumper 2012-05-25 00:21:00 -07:00
parent e710287196
commit 36def67dfd
4 changed files with 12 additions and 3 deletions

View File

@ -55,6 +55,11 @@ AC_CHECK_LIB([freerdp-codec], [freerdp_image_convert],, AC_MSG_ERROR("libfreerdp
# Checks for header files. # Checks for header files.
AC_CHECK_HEADERS([guacamole/client.h guacamole/guacio.h guacamole/protocol.h freerdp/locale/keyboard.h freerdp/kbd/layouts.h]) AC_CHECK_HEADERS([guacamole/client.h guacamole/guacio.h guacamole/protocol.h freerdp/locale/keyboard.h freerdp/kbd/layouts.h])
# Check for FreeRDP version-specific features
AC_CHECK_MEMBERS([rdpPointer.SetDefault, rdpPointer.SetNull],
[], [],
[[#include <freerdp/freerdp.h>]])
# Checks for library functions. # Checks for library functions.
AC_FUNC_MALLOC AC_FUNC_MALLOC

View File

@ -71,6 +71,6 @@ extern unsigned char guac_rdp_default_pointer[];
* *
* @param client The guac_client to send the cursor to. * @param client The guac_client to send the cursor to.
*/ */
void guac_rdp_pointer_set_default(guac_client* client); void guac_rdp_set_default_pointer(guac_client* client);
#endif #endif

View File

@ -152,8 +152,12 @@ boolean rdp_freerdp_pre_connect(freerdp* instance) {
pointer->New = guac_rdp_pointer_new; pointer->New = guac_rdp_pointer_new;
pointer->Free = guac_rdp_pointer_free; pointer->Free = guac_rdp_pointer_free;
pointer->Set = guac_rdp_pointer_set; pointer->Set = guac_rdp_pointer_set;
#ifdef HAVE_RDPPOINTER_SETNULL
pointer->SetNull = guac_rdp_pointer_set_null; pointer->SetNull = guac_rdp_pointer_set_null;
#endif
#ifdef HAVE_RDPPOINTER_SETDEFAULT
pointer->SetDefault = guac_rdp_pointer_set_default; pointer->SetDefault = guac_rdp_pointer_set_default;
#endif
graphics_register_pointer(context->graphics, pointer); graphics_register_pointer(context->graphics, pointer);
xfree(pointer); xfree(pointer);
@ -433,7 +437,7 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
CAIRO_FORMAT_ARGB32, settings->width, settings->height); CAIRO_FORMAT_ARGB32, settings->width, settings->height);
/* Set default pointer */ /* Set default pointer */
guac_rdp_pointer_set_default(client); guac_rdp_set_default_pointer(client);
/* Success */ /* Success */
return 0; return 0;

View File

@ -76,7 +76,7 @@ unsigned char guac_rdp_default_pointer[] = {
}; };
void guac_rdp_pointer_set_default(guac_client* client) { void guac_rdp_set_default_pointer(guac_client* client) {
guac_socket* socket = client->socket; guac_socket* socket = client->socket;