From bdf5a3ad3fb9e626a0c1cc2264934f26d07d06fc Mon Sep 17 00:00:00 2001 From: cslashm Date: Wed, 23 May 2018 10:22:55 +0200 Subject: Fix PCSC compilation under windows PR3843 based on release-v0.12 => rebased on master --- src/device/device_ledger.cpp | 9 +++++++++ src/device/device_ledger.hpp | 5 +++++ 2 files changed, 14 insertions(+) (limited to 'src/device') diff --git a/src/device/device_ledger.cpp b/src/device/device_ledger.cpp index 3b9ab6744..aedaf8382 100644 --- a/src/device/device_ledger.cpp +++ b/src/device/device_ledger.cpp @@ -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; } diff --git a/src/device/device_ledger.hpp b/src/device/device_ledger.hpp index f1fcaab87..b62bdf959 100644 --- a/src/device/device_ledger.hpp +++ b/src/device/device_ledger.hpp @@ -33,8 +33,13 @@ #include #include #include "device.hpp" +#ifdef WIN32 +#include +#define MAX_ATR_SIZE 33 +#else #include #include +#endif #include #include -- cgit v1.2.3