fix compilation when libcacard isn't installed

This commit is contained in:
Christophe Fergeau 2011-05-13 13:25:05 +02:00 committed by Marc-André Lureau
parent 13a8be965a
commit f36bc5e257
4 changed files with 20 additions and 0 deletions

View File

@ -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);

View File

@ -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
}

View File

@ -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;
}

View File

@ -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",