stdalign.h 677 B

1234567891011121314151617181920212223242526
  1. #ifndef _NT_STDALIGN_H_
  2. #define _NT_STDALIGN_H_
  3. /* This header has the necessary stuff from lib/stdalign.in.h, but
  4. avoids the need to have Sed at build time. */
  5. #include <stddef.h>
  6. #if defined __cplusplus
  7. template <class __t> struct __alignof_helper { char __a; __t __b; };
  8. # define _Alignof(type) offsetof (__alignof_helper<type>, __b)
  9. #else
  10. # define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
  11. #endif
  12. #define alignof _Alignof
  13. #if __GNUC__
  14. # define _Alignas(a) __attribute__ ((__aligned__ (a)))
  15. #elif 1300 <= _MSC_VER
  16. # define _Alignas(a) __declspec (align (a))
  17. #endif
  18. #ifdef _Alignas
  19. # define alignas _Alignas
  20. #endif
  21. #endif /* _NT_STDALIGN_H_ */