diff options
Diffstat (limited to 'as/align.h')
-rw-r--r-- | as/align.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/as/align.h b/as/align.h new file mode 100644 index 0000000..52b1e89 --- /dev/null +++ b/as/align.h @@ -0,0 +1,23 @@ +/* align.h - memory alignment requirements for linker */ + +/* Copyright (C) 1994 Bruce Evans */ + +#ifndef S_ALIGNMENT +# define align(x) +#else + +#if defined(__STDC__) && defined(_POSIX_SOURCE) +# define align(x) ((x)=(void *) \ + (((ssize_t)(x) + (S_ALIGNMENT-1)) & ~(S_ALIGNMENT-1))) +#else +# define align(x) ((x)=(void *) \ + ((char *)(x) + ((S_ALIGNMENT-(char)(x)) & (S_ALIGNMENT-1)))) +#endif +#endif + + + + + + + |