Fix PCSC compilation under windows

PR3843 based on release-v0.12 => rebased on master
This commit is contained in:
cslashm 2018-05-23 10:22:55 +02:00
parent a2cef8cba4
commit bdf5a3ad3f
4 changed files with 23 additions and 0 deletions

View file

@ -48,6 +48,15 @@ namespace hw {
/* ===================================================================== */
/* === Debug ==== */
/* ===================================================================== */
#ifdef WIN32
static char *pcsc_stringify_error(LONG rv) {
static __thread char out[20];
sprintf_s(out, sizeof(out), "0x%08lX", rv);
return out;
}
#endif
void set_apdu_verbose(bool verbose) {
apdu_verbose = verbose;
}

View file

@ -33,8 +33,13 @@
#include <cstddef>
#include <string>
#include "device.hpp"
#ifdef WIN32
#include <winscard.h>
#define MAX_ATR_SIZE 33
#else
#include <PCSC/winscard.h>
#include <PCSC/wintypes.h>
#endif
#include <boost/thread/mutex.hpp>
#include <boost/thread/recursive_mutex.hpp>