irrpack.h 772 B

12345678910111213141516171819202122232425
  1. // Copyright (C) 2007-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. // include this file right before the data structures to be 1-aligned
  5. // and add to each structure the PACK_STRUCT define just like this:
  6. // struct mystruct
  7. // {
  8. // ...
  9. // } PACK_STRUCT;
  10. // Always include the irrunpack.h file right after the last type declared
  11. // like this, and do not put any other types with different alignment
  12. // in between!
  13. // byte-align structures
  14. #if defined(_MSC_VER)
  15. #pragma warning(disable : 4103)
  16. #pragma pack(push, packing)
  17. #pragma pack(1)
  18. #define PACK_STRUCT
  19. #elif defined(__GNUC__)
  20. #define PACK_STRUCT __attribute__((packed))
  21. #else
  22. #error compiler not supported
  23. #endif