aboutsummaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorcslashm <cslashm@gmail.com>2018-05-22 16:02:00 +0200
committercslashm <cslashm@gmail.com>2018-05-22 19:43:49 +0200
commite05a17f1ea4af53f037c492bd3e97dd76f1e094c (patch)
tree4b639207738cffc93848255b46f447330397ee13 /src/device
parentMerge pull request #3801 (diff)
downloadmonero-e05a17f1ea4af53f037c492bd3e97dd76f1e094c.tar.xz
Fix PCSC discovery under Windows/MSYS
Fix PCSC compilation under windows
Diffstat (limited to 'src/device')
-rw-r--r--src/device/device_ledger.cpp9
-rw-r--r--src/device/device_ledger.hpp5
2 files changed, 14 insertions, 0 deletions
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 <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>