align.h 410 B

123456789101112131415161718192021222324
  1. /* align.h - memory alignment requirements for linker */
  2. /* Copyright (C) 1994 Bruce Evans */
  3. #ifndef S_ALIGNMENT
  4. # define align(x)
  5. #else
  6. #if defined(__STDC__) && defined(_POSIX_SOURCE)
  7. # define align(x) ((x)=(void *) \
  8. (((ssize_t)(x) + (S_ALIGNMENT-1)) & ~(S_ALIGNMENT-1)))
  9. #else
  10. # define align(x) ((x)=(void *) \
  11. ((char *)(x) + ((S_ALIGNMENT-(char)(x)) & (S_ALIGNMENT-1))))
  12. #endif
  13. #endif