From 84c09ce88158bb5850a58103d1d97c490d453fd8 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Mon, 15 Jul 2019 19:21:19 +0300 Subject: [PATCH] added define PACKED --- client/emv/apduinfo.c | 2 -- client/emv/apduinfo.h | 6 ++++-- client/util.h | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/emv/apduinfo.c b/client/emv/apduinfo.c index a7a8e1672..469078456 100644 --- a/client/emv/apduinfo.c +++ b/client/emv/apduinfo.c @@ -10,8 +10,6 @@ #include "apduinfo.h" -#include "util.h" - const APDUCode APDUCodeTable[] = { // ID Type Description {"XXXX", APDUCODE_TYPE_NONE, ""}, // blank string diff --git a/client/emv/apduinfo.h b/client/emv/apduinfo.h index 1fbb3bf00..b81877366 100644 --- a/client/emv/apduinfo.h +++ b/client/emv/apduinfo.h @@ -17,6 +17,8 @@ #include #include +#include "util.h" + #define APDUCODE_TYPE_NONE 0 #define APDUCODE_TYPE_INFO 1 #define APDUCODE_TYPE_WARNING 2 @@ -38,7 +40,7 @@ typedef struct { uint8_t p1; uint8_t p2; uint8_t lc[3]; -} __attribute__((packed)) ExtAPDUHeader; +} PACKED ExtAPDUHeader; typedef struct { uint8_t cla; @@ -50,7 +52,7 @@ typedef struct { uint32_t le; bool extended_apdu; uint8_t case_type; -} __attribute__((packed)) APDUStruct; +} PACKED APDUStruct; extern int APDUDecode(uint8_t *data, int len, APDUStruct *apdu); extern int APDUEncode(APDUStruct *apdu, uint8_t *data, int *len); diff --git a/client/util.h b/client/util.h index e194bb5be..aade8bf96 100644 --- a/client/util.h +++ b/client/util.h @@ -21,6 +21,12 @@ #include "ui.h" // PrintAndLog #include "commonutil.h" +#ifdef _MSC_VER +#define PACKED +#else +#define PACKED __attribute__((packed)) +#endif + #ifdef ANDROID #include #endif