diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2017-03-09 18:49:24 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2017-03-11 15:41:45 +0100 |
commit | adbc664125142c434294bfa795666c90c7608429 (patch) | |
tree | 15db66af5acd4422b5e66678dbe45a953b9dbdb0 /misc.cc | |
parent | c69604e8ba099b1421af86c34d904b0b380f996c (diff) | |
download | libnitrokey-adbc664125142c434294bfa795666c90c7608429.tar.gz libnitrokey-adbc664125142c434294bfa795666c90c7608429.tar.bz2 |
Adjust for compilation on Visual Studio 2017
Building works however tests are not. Possibly linking with original hidapi solution would work.
Diffstat (limited to 'misc.cc')
-rw-r--r-- | misc.cc | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -5,18 +5,19 @@ #include <cstdlib> #include <cstring> #include "LibraryException.h" +#include <vector> namespace nitrokey { namespace misc { -std::vector<uint8_t> hex_string_to_byte(const char* hexString){ +::std::vector<uint8_t> hex_string_to_byte(const char* hexString){ const size_t big_string_size = 256; //arbitrary 'big' number const size_t s_size = strlen(hexString); const size_t d_size = s_size/2; if (s_size%2!=0 || s_size>big_string_size){ throw InvalidHexString(0); } - auto data = std::vector<uint8_t>(); + auto data = ::std::vector<uint8_t>(); data.reserve(d_size); char buf[2]; @@ -36,9 +37,9 @@ std::vector<uint8_t> hex_string_to_byte(const char* hexString){ }; #include <cctype> -std::string hexdump(const char *p, size_t size, bool print_header, +::std::string hexdump(const char *p, size_t size, bool print_header, bool print_ascii, bool print_empty) { - std::stringstream out; + ::std::stringstream out; char formatbuf[128]; const char *pstart = p; @@ -68,7 +69,7 @@ std::string hexdump(const char *p, size_t size, bool print_header, out << '.'; } } - out << std::endl; + out << ::std::endl; } return out.str(); } |