fix __packed attribute for MSVC (#646)

This commit is contained in:
Graham Sanderson 2021-11-01 13:29:02 -05:00 committed by GitHub
parent da476610e2
commit d0af70bd77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,8 +27,14 @@ extern "C" {
#define __scratch_x(group) #define __scratch_x(group)
#define __scratch_y(group) #define __scratch_y(group)
#ifndef _MSC_VER
#define __packed __attribute__((packed)) #define __packed __attribute__((packed))
#define __packed_aligned __packed __attribute((aligned)) #define __packed_aligned __packed __attribute((aligned))
#else
// MSVC requires #pragma pack which isn't compatible with a single attribute style define
#define __packed
#define __packed_aligned
#endif
#define __time_critical_func(x) x #define __time_critical_func(x) x
#define __after_data(group) #define __after_data(group)