vrshoot
annotate 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 |
rev | line source |
---|---|
nuclear@0 | 1 |
nuclear@0 | 2 |
nuclear@0 | 3 // =============================================================================== |
nuclear@0 | 4 // May be included multiple times - sets structure packing to 1 |
nuclear@0 | 5 // for all supported compilers. #include <poppack1.h> reverts the changes. |
nuclear@0 | 6 // |
nuclear@0 | 7 // Currently this works on the following compilers: |
nuclear@0 | 8 // MSVC 7,8,9 |
nuclear@0 | 9 // GCC |
nuclear@0 | 10 // BORLAND (complains about 'pack state changed but not reverted', but works) |
nuclear@0 | 11 // |
nuclear@0 | 12 // |
nuclear@0 | 13 // USAGE: |
nuclear@0 | 14 // |
nuclear@0 | 15 // struct StructToBePacked { |
nuclear@0 | 16 // } PACK_STRUCT; |
nuclear@0 | 17 // |
nuclear@0 | 18 // =============================================================================== |
nuclear@0 | 19 |
nuclear@0 | 20 #ifdef AI_PUSHPACK_IS_DEFINED |
nuclear@0 | 21 # error poppack1.h must be included after pushpack1.h |
nuclear@0 | 22 #endif |
nuclear@0 | 23 |
nuclear@0 | 24 #if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) |
nuclear@0 | 25 # pragma pack(push,1) |
nuclear@0 | 26 # define PACK_STRUCT |
nuclear@0 | 27 #elif defined( __GNUC__ ) |
nuclear@0 | 28 # define PACK_STRUCT __attribute__((packed)) |
nuclear@0 | 29 #else |
nuclear@0 | 30 # error Compiler not supported |
nuclear@0 | 31 #endif |
nuclear@0 | 32 |
nuclear@0 | 33 #if defined(_MSC_VER) |
nuclear@0 | 34 |
nuclear@0 | 35 // C4103: Packing was changed after the inclusion of the header, propably missing #pragma pop |
nuclear@0 | 36 # pragma warning (disable : 4103) |
nuclear@0 | 37 #endif |
nuclear@0 | 38 |
nuclear@0 | 39 #define AI_PUSHPACK_IS_DEFINED |
nuclear@0 | 40 |
nuclear@0 | 41 |