From a5eb7d1496ef45e6c7d22a67b1c74e7af00dc1b6 Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Fri, 29 Apr 2022 18:57:26 +0300 Subject: [PATCH] [build] Fix conditions for struct packing macro, detect MSVC instead of everything else * Fixes building on apple systems --- src/alf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/alf.h b/src/alf.h index a95be1af..8403e935 100644 --- a/src/alf.h +++ b/src/alf.h @@ -166,10 +166,10 @@ typedef enum { //---------------------------------------------------------------- //-------------------------typedef structs---------------------------- -#if defined(__MINGW32__) || defined(__MINGW64__) || defined(__linux__) -#define PACK(__Type__, __Declaration__) __Type__ __attribute__((__packed__)) __Declaration__ ; -#else +#if _MSC_VER #define PACK(__Type__,__Declaration__) __pragma(pack(push, 1)) __Type__ __Declaration__ __pragma(pack(pop)); +#else +#define PACK(__Type__, __Declaration__) __Type__ __attribute__((__packed__)) __Declaration__ ; #endif