mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-08-23 10:33:50 -04:00
nasmlib.h: Introduce ALIGN helpers
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
53252e0cc3
commit
89fe355ad0
@ -254,6 +254,13 @@ void standard_extension(char *inname, char *outname, char *extension);
|
|||||||
for (pos = head, n = (pos ? pos->next : NULL); pos; \
|
for (pos = head, n = (pos ? pos->next : NULL); pos; \
|
||||||
pos = n, n = (n ? n->next : NULL))
|
pos = n, n = (n ? n->next : NULL))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Power of 2 align helpers
|
||||||
|
*/
|
||||||
|
#define ALIGN_MASK(v, mask) (((v) + (mask)) & ~(mask))
|
||||||
|
#define ALIGN(v, a) ALIGN_MASK(v, (a) - 1)
|
||||||
|
#define IS_ALIGNED(v, a) (((v) & ((a) - 1)) == 0)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* some handy macros that will probably be of use in more than one
|
* some handy macros that will probably be of use in more than one
|
||||||
* output format: convert integers into little-endian byte packed
|
* output format: convert integers into little-endian byte packed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user