From 2484d1c8591300736dd9d9f40b00f0c69eb1b335 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 28 Oct 2016 16:31:48 +0100 Subject: [PATCH] Problem: MS VC++ build broken Solution: try to detect architecture if building with VC++ and hardcode pointer size accordingly. Expressions are not allowed inside declspec intrinsics, which includes other intrinsics. --- include/zmq.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/zmq.h b/include/zmq.h index a24ecabc..778d5e45 100644 --- a/include/zmq.h +++ b/include/zmq.h @@ -238,8 +238,10 @@ typedef struct zmq_msg_t { (defined (__SUNPRO_C) && __SUNPRO_C >= 0x590) || \ (defined (__SUNPRO_CC) && __SUNPRO_CC >= 0x590) unsigned char _ [64] __attribute__ ((aligned (sizeof (void *)))); -#elif defined(_MSC_VER) - __declspec (align (sizeof (void *))) unsigned char _ [64]; +#elif defined (_MSC_VER) && (defined (_M_X64) || defined (_M_ARM64)) + __declspec (align (8)) unsigned char _ [64]; +#elif defined (_MSC_VER) && (defined (_M_IX86) || defined (_M_ARM_ARMV7VE)) + __declspec (align (4)) unsigned char _ [64]; #else unsigned char _ [64]; #endif