diff --git a/configure.ac b/configure.ac index 3b6d7e6f84..72f773507a 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h time.h sys/time.h syslo # Cygwin build CYWGIN_LDFLAGS= -CYGWIN_CFLAGS= +CYGWIN_CFLAGS=-Werror -Wall -pedantic AC_ARG_WITH([cygwin], [AS_HELP_STRING([--with-cygwin], [use Cygwin to build under Windows @<:@default=no@:>@])], @@ -53,7 +53,7 @@ AM_CONDITIONAL([CYGWIN_BUILD], [test "x${with_cygwin}" = "xyes"]) if test "x$with_cygwin" = "xyes" then CYWGIN_LDFLAGS=-no-undefined - CYGWIN_CFLAGS=-Wno-error=expansion-to-defined + CYGWIN_CFLAGS=-Werror -Wall -Wno-error=expansion-to-defined AC_DEFINE([CYGWIN_BUILD],,[Build against Cygwin on Windows]) fi diff --git a/src/common-ssh/Makefile.am b/src/common-ssh/Makefile.am index 19a0333adf..23dcb073aa 100644 --- a/src/common-ssh/Makefile.am +++ b/src/common-ssh/Makefile.am @@ -44,7 +44,6 @@ noinst_HEADERS = \ common-ssh/user.h libguac_common_ssh_la_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ \ @LIBGUAC_INCLUDE@ diff --git a/src/common-ssh/tests/Makefile.am b/src/common-ssh/tests/Makefile.am index b5d330bf40..3c77a6c39c 100644 --- a/src/common-ssh/tests/Makefile.am +++ b/src/common-ssh/tests/Makefile.am @@ -37,7 +37,6 @@ test_common_ssh_SOURCES = \ sftp/normalize_path.c test_common_ssh_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ \ @COMMON_SSH_INCLUDE@ \ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 6baa4aea88..380d7dd99c 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -63,7 +63,6 @@ libguac_common_la_SOURCES = \ surface.c libguac_common_la_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_INCLUDE@ diff --git a/src/common/tests/Makefile.am b/src/common/tests/Makefile.am index 049397a45c..ca39288e9b 100644 --- a/src/common/tests/Makefile.am +++ b/src/common/tests/Makefile.am @@ -49,7 +49,6 @@ test_common_SOURCES = \ string/split.c test_common_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ diff --git a/src/guacd/Makefile.am b/src/guacd/Makefile.am index c1ea258106..59eb8591d5 100644 --- a/src/guacd/Makefile.am +++ b/src/guacd/Makefile.am @@ -60,7 +60,6 @@ guacd_SOURCES += move-pipe.c endif guacd_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ \ @LIBGUAC_INCLUDE@ diff --git a/src/libguac/Makefile.am b/src/libguac/Makefile.am index 08f21d8acc..1dfa5738ab 100644 --- a/src/libguac/Makefile.am +++ b/src/libguac/Makefile.am @@ -85,8 +85,7 @@ noinst_HEADERS = \ encode-png.h \ palette.h \ user-handlers.h \ - raw_encoder.h \ - wait-fd.h + raw_encoder.h libguac_la_SOURCES = \ argv.c \ @@ -116,7 +115,6 @@ libguac_la_SOURCES = \ user.c \ user-handlers.c \ user-handshake.c \ - wait-fd.c \ wol.c # Compile WebP support if available @@ -145,11 +143,13 @@ libguac_la_SOURCES += wait-handle.c libguacinc_HEADERS += guacamole/handle-helpers.h libguacinc_HEADERS += guacamole/socket-handle.h libguacinc_HEADERS += guacamole/wait-handle.h +else +libguac_la_SOURCES += wait-fd.c +libguacinc_HEADERS += guacamole/wait-fd.h endif libguac_la_CFLAGS = \ - @CYGWIN_CFLAGS@ \ - -Werror -Wall -pedantic + @CYGWIN_CFLAGS@ libguac_la_LDFLAGS = \ -version-info 22:0:1 \ diff --git a/src/libguac/client.c b/src/libguac/client.c index 6c3b3aedd7..84adf9a825 100644 --- a/src/libguac/client.c +++ b/src/libguac/client.c @@ -48,6 +48,7 @@ #ifdef CYGWIN_BUILD #include +#include #endif /** @@ -518,13 +519,13 @@ static int guac_client_start_pending_users_timer(guac_client* client) { #ifdef CYGWIN_BUILD if (!CreateTimerQueueTimer( - &(client->__pending_users_timer)), + &(client->__pending_users_timer), NULL, guac_client_promote_pending_users, client, GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL, - GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL - 0) { + GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL, + 0)) { // oh noes error return 1; @@ -545,7 +546,6 @@ static int guac_client_start_pending_users_timer(guac_client* client) { pthread_mutex_unlock(&(client->__pending_users_timer_mutex)); return 1; } -#endif /* Configure the pending users timer to run on the defined interval */ struct itimerspec time_config = { @@ -560,6 +560,7 @@ static int guac_client_start_pending_users_timer(guac_client* client) { pthread_mutex_unlock(&(client->__pending_users_timer_mutex)); return 1; } +#endif /* Mark the timer as registered but not yet running */ client->__pending_users_timer_state = GUAC_CLIENT_PENDING_TIMER_REGISTERED; diff --git a/src/libguac/guacamole/client.h b/src/libguac/guacamole/client.h index 9da16e2abd..89df8bdaf2 100644 --- a/src/libguac/guacamole/client.h +++ b/src/libguac/guacamole/client.h @@ -26,6 +26,8 @@ * @file client.h */ +#include "config.h" + #include "client-fntypes.h" #include "client-types.h" #include "client-constants.h" diff --git a/src/libguac/id.c b/src/libguac/id.c index c42bdff81e..10b4476404 100644 --- a/src/libguac/id.c +++ b/src/libguac/id.c @@ -24,6 +24,7 @@ #ifdef CYGWIN_BUILD +#include #include #elif defined(HAVE_LIBUUID) #include @@ -58,7 +59,7 @@ char* guac_generate_id(char prefix) { /* Convert the UUID to an all-caps, null-terminated tring */ RPC_CSTR uuid_string; - if (UuidToString(uuid, &uuid_string) == RPC_S_OUT_OF_MEMORY) { + if (UuidToString(&uuid, &uuid_string) == RPC_S_OUT_OF_MEMORY) { guac_error = GUAC_STATUS_NO_MEMORY; guac_error_message = "Could not allocate memory for unique ID"; return NULL; @@ -68,7 +69,7 @@ char* guac_generate_id(char prefix) { for (int i = 0; i < GUAC_UUID_LEN; i++) identifier[i] = tolower(uuid_string[i]); - RpcStringFree(uuid_string); + RpcStringFree(&uuid_string); #else diff --git a/src/libguac/tests/Makefile.am b/src/libguac/tests/Makefile.am index 68943da90d..79180c6ecf 100644 --- a/src/libguac/tests/Makefile.am +++ b/src/libguac/tests/Makefile.am @@ -56,7 +56,6 @@ test_libguac_SOURCES = \ test_libguac_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_INCLUDE@ diff --git a/src/protocols/kubernetes/tests/Makefile.am b/src/protocols/kubernetes/tests/Makefile.am index 1d1a8f4432..b1936b612c 100644 --- a/src/protocols/kubernetes/tests/Makefile.am +++ b/src/protocols/kubernetes/tests/Makefile.am @@ -38,7 +38,6 @@ test_kubernetes_SOURCES = \ url/escape.c test_kubernetes_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_CLIENT_KUBERNETES_INCLUDE@ \ @LIBGUAC_INCLUDE@ diff --git a/src/protocols/rdp/tests/Makefile.am b/src/protocols/rdp/tests/Makefile.am index 41206a1e57..da6cbd75d8 100644 --- a/src/protocols/rdp/tests/Makefile.am +++ b/src/protocols/rdp/tests/Makefile.am @@ -38,7 +38,6 @@ test_rdp_SOURCES = \ fs/normalize_path.c test_rdp_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_CLIENT_RDP_INCLUDE@ \ @LIBGUAC_INCLUDE@ diff --git a/src/protocols/vnc/Makefile.am b/src/protocols/vnc/Makefile.am index 517de2b5c7..e7a3f4b709 100644 --- a/src/protocols/vnc/Makefile.am +++ b/src/protocols/vnc/Makefile.am @@ -55,7 +55,6 @@ noinst_HEADERS = \ vnc.h libguac_client_vnc_la_CFLAGS = \ - -Werror -Wall -pedantic -Iinclude \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ \ @COMMON_SSH_INCLUDE@ \ diff --git a/src/pulse/Makefile.am b/src/pulse/Makefile.am index 0a9b066cd5..4bef434746 100644 --- a/src/pulse/Makefile.am +++ b/src/pulse/Makefile.am @@ -35,7 +35,6 @@ libguac_pulse_la_SOURCES = \ pulse.c libguac_pulse_la_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_INCLUDE@