diff options
-rw-r--r-- | common/marshallers.h | 6 | ||||
-rw-r--r-- | common/messages.h | 8 | ||||
-rw-r--r-- | gtk/spice-widget.c | 4 | ||||
-rw-r--r-- | gtk/spicy.c | 2 |
4 files changed, 20 insertions, 0 deletions
diff --git a/common/marshallers.h b/common/marshallers.h index b30773a..c192d5b 100644 --- a/common/marshallers.h +++ b/common/marshallers.h @@ -19,6 +19,10 @@ #ifndef _H_MARSHALLERS #define _H_MARSHALLERS +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <spice/protocol.h> #include <marshaller.h> #include <messages.h> @@ -55,11 +59,13 @@ typedef struct { void (*msgc_tunnel_socket_closed_ack)(SpiceMarshaller *m, SpiceMsgcTunnelSocketClosedAck *msg); void (*msgc_tunnel_socket_data)(SpiceMarshaller *m, SpiceMsgcTunnelSocketData *msg); void (*msgc_tunnel_socket_token)(SpiceMarshaller *m, SpiceMsgcTunnelSocketTokens *msg); +#ifdef USE_SMARTCARD void (*msgc_smartcard_atr)(SpiceMarshaller *m, VSCMsgATR *msg); void (*msgc_smartcard_error)(SpiceMarshaller *m, VSCMsgError *msg); void (*msgc_smartcard_header)(SpiceMarshaller *m, VSCMsgHeader *msg); void (*msgc_smartcard_msg)(SpiceMarshaller *m, SpiceMsgcSmartcard *msg, SpiceMarshaller **reader_name_out); void (*msgc_smartcard_reader_add)(SpiceMarshaller *m, VSCMsgReaderAdd *msg); +#endif } SpiceMessageMarshallers; SpiceMessageMarshallers *spice_message_marshallers_get(void); diff --git a/common/messages.h b/common/messages.h index e70f4c6..556496b 100644 --- a/common/messages.h +++ b/common/messages.h @@ -31,8 +31,14 @@ #ifndef _H_MESSAGES #define _H_MESSAGES +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <spice/protocol.h> +#ifdef USE_SMARTCARD #include <vscard_common.h> +#endif #include "draw.h" #ifdef __cplusplus @@ -508,6 +514,7 @@ typedef struct SpiceMsgcTunnelSocketTokens { uint32_t num_tokens; } SpiceMsgcTunnelSocketTokens; +#ifdef USE_SMARTCARD typedef struct SpiceMsgSmartcard { VSCMsgType type; uint32_t length; @@ -523,6 +530,7 @@ typedef struct SpiceMsgcSmartcard { VSCMsgReaderAdd add; }; } SpiceMsgcSmartcard; +#endif #ifdef __cplusplus } diff --git a/gtk/spice-widget.c b/gtk/spice-widget.c index 337b0e9..ed5b4d6 100644 --- a/gtk/spice-widget.c +++ b/gtk/spice-widget.c @@ -1867,11 +1867,13 @@ static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data) return; } +#ifdef USE_SMARTCARD if (SPICE_IS_SMARTCARD_CHANNEL(channel)) { d->smartcard = SPICE_SMARTCARD_CHANNEL(channel); spice_channel_connect(channel); return; } +#endif return; } @@ -1909,10 +1911,12 @@ static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer dat return; } +#ifdef USE_SMARTCARD if (SPICE_IS_SMARTCARD_CHANNEL(channel)) { d->smartcard = NULL; return; } +#endif return; } diff --git a/gtk/spicy.c b/gtk/spicy.c index 8cc6d7d..b16e3f5 100644 --- a/gtk/spicy.c +++ b/gtk/spicy.c @@ -658,6 +658,7 @@ static const GtkActionEntry entries[] = { .callback = G_CALLBACK(menu_cb_ungrab), .accelerator = "<shift>F12", },{ +#ifdef USE_SMARTCARD .name = "InsertSmartCard", .label = N_("_Insert Smartcard"), .callback = G_CALLBACK(menu_cb_insert_smartcard), @@ -668,6 +669,7 @@ static const GtkActionEntry entries[] = { .callback = G_CALLBACK(menu_cb_remove_smartcard), .accelerator = "<shift>F9", },{ +#endif /* Help menu */ .name = "About", |