From adbc664125142c434294bfa795666c90c7608429 Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Thu, 9 Mar 2017 18:49:24 +0100 Subject: Adjust for compilation on Visual Studio 2017 Building works however tests are not. Possibly linking with original hidapi solution would work. --- include/device_proto.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/device_proto.h') diff --git a/include/device_proto.h b/include/device_proto.h index cbb74fb..1e381dd 100644 --- a/include/device_proto.h +++ b/include/device_proto.h @@ -6,7 +6,6 @@ #include #include #include -#include // a local version for compatibility with Windows #include #include "cxx_semantics.h" @@ -34,6 +33,7 @@ #include #include "DeviceCommunicationExceptions.h" +#define bzero(b,len) (memset((b), '\0', (len)), (void) 0) namespace nitrokey { namespace proto { @@ -43,7 +43,7 @@ namespace nitrokey { * * TODO (future) support for Big Endian */ - +#pragma pack (push,1) /* * Every packet is a USB HID report (check USB spec) */ @@ -181,8 +181,10 @@ namespace nitrokey { typedef command_payload CommandPayload; typedef response_payload ResponsePayload; + typedef struct HIDReport OutgoingPacket; typedef struct DeviceResponse ResponsePacket; +#pragma pack (pop) static_assert(std::is_pod::value, "outgoingpacket must be a pod type"); @@ -216,7 +218,7 @@ namespace nitrokey { static std::mutex send_receive_mtx; std::lock_guard guard(send_receive_mtx); - Log::instance()(__PRETTY_FUNCTION__, Loglevel::DEBUG_L2); + Log::instance()(__FUNCTION__, Loglevel::DEBUG_L2); if (dev == nullptr){ throw DeviceNotConnected("Device not initialized"); -- cgit v1.2.1