[build] Fix conditions for struct packing macro, detect MSVC instead of everything else

* Fixes building on apple systems
This commit is contained in:
Marko Viitanen 2022-04-29 18:57:26 +03:00
parent 4005b9da4b
commit a5eb7d1496

View file

@ -166,10 +166,10 @@ typedef enum {
//---------------------------------------------------------------- //----------------------------------------------------------------
//-------------------------typedef structs---------------------------- //-------------------------typedef structs----------------------------
#if defined(__MINGW32__) || defined(__MINGW64__) || defined(__linux__) #if _MSC_VER
#define PACK(__Type__, __Declaration__) __Type__ __attribute__((__packed__)) __Declaration__ ;
#else
#define PACK(__Type__,__Declaration__) __pragma(pack(push, 1)) __Type__ __Declaration__ __pragma(pack(pop)); #define PACK(__Type__,__Declaration__) __pragma(pack(push, 1)) __Type__ __Declaration__ __pragma(pack(pop));
#else
#define PACK(__Type__, __Declaration__) __Type__ __attribute__((__packed__)) __Declaration__ ;
#endif #endif