vrshoot
diff libs/assimp/assimp/Compiler/pushpack1.h @ 0:b2f14e535253
initial commit
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 19:58:19 +0200 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libs/assimp/assimp/Compiler/pushpack1.h Sat Feb 01 19:58:19 2014 +0200 1.3 @@ -0,0 +1,41 @@ 1.4 + 1.5 + 1.6 +// =============================================================================== 1.7 +// May be included multiple times - sets structure packing to 1 1.8 +// for all supported compilers. #include <poppack1.h> reverts the changes. 1.9 +// 1.10 +// Currently this works on the following compilers: 1.11 +// MSVC 7,8,9 1.12 +// GCC 1.13 +// BORLAND (complains about 'pack state changed but not reverted', but works) 1.14 +// 1.15 +// 1.16 +// USAGE: 1.17 +// 1.18 +// struct StructToBePacked { 1.19 +// } PACK_STRUCT; 1.20 +// 1.21 +// =============================================================================== 1.22 + 1.23 +#ifdef AI_PUSHPACK_IS_DEFINED 1.24 +# error poppack1.h must be included after pushpack1.h 1.25 +#endif 1.26 + 1.27 +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 1.28 +# pragma pack(push,1) 1.29 +# define PACK_STRUCT 1.30 +#elif defined( __GNUC__ ) 1.31 +# define PACK_STRUCT __attribute__((packed)) 1.32 +#else 1.33 +# error Compiler not supported 1.34 +#endif 1.35 + 1.36 +#if defined(_MSC_VER) 1.37 + 1.38 +// C4103: Packing was changed after the inclusion of the header, propably missing #pragma pop 1.39 +# pragma warning (disable : 4103) 1.40 +#endif 1.41 + 1.42 +#define AI_PUSHPACK_IS_DEFINED 1.43 + 1.44 +