Skip to content

Commit 002dc3a

Browse files
committed
toolchain: Introduce __ALIGNED(x) macro
The __ALIGNED(x) macro may be used to tell the compiler to align the symbol's address to an 'x' byte boundary. Note that 'x' must be a power of two. Signed-off-by: Peter Mitsis <peter.mitsis@gmail.com>
1 parent 7da8121 commit 002dc3a

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

code/globalincs/toolchain/clang.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define SCP_FORMAT_STRING_ARGS(x,y) __attribute__((format(printf, x, y)))
2222

2323
#define __UNUSED __attribute__((__unused__))
24+
#define __ALIGNED(x) __attribute__((__aligned__(x)))
2425

2526
#ifdef NO_RESTRICT_USE
2627
# define RESTRICT

code/globalincs/toolchain/gcc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define SCP_FORMAT_STRING_ARGS(x,y) __attribute__((format(printf, x, y)))
2222

2323
#define __UNUSED __attribute__((__unused__))
24+
#define __ALIGNED(x) __attribute__((__aligned__(x)))
2425

2526
#ifdef NO_RESTRICT_USE
2627
# define RESTRICT

code/globalincs/toolchain/mingw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define SCP_FORMAT_STRING_ARGS(x,y) __attribute__((format(printf, x, y)))
2222

2323
#define __UNUSED __attribute__((__unused__))
24+
#define __ALIGNED(x) __attribute__((__aligned__(x)))
2425

2526
#ifdef NO_RESTRICT_USE
2627
# define RESTRICT

code/globalincs/toolchain/msvc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#define __attribute__(x)
2626
#define __UNUSED
27+
#define __ALIGNED(x) __declspec(align(x))
2728

2829
#ifdef NO_RESTRICT_USE
2930
# define RESTRICT

0 commit comments

Comments
 (0)