libtonc
Type attributes

Modules

 Primary types
 

Macros

#define IWRAM_DATA   __attribute__((section(".iwram")))
 Put variable in IWRAM (default).
 
#define EWRAM_DATA   __attribute__((section(".ewram")))
 Put variable in EWRAM.
 
#define EWRAM_BSS   __attribute__((section(".sbss")))
 Put non-initialized variable in EWRAM.
 
#define IWRAM_CODE   __attribute__((section(".iwram"), long_call))
 Put function in IWRAM.
 
#define EWRAM_CODE   __attribute__((section(".ewram"), long_call))
 Put function in EWRAM.
 
#define ALIGN(n)   __attribute__((aligned(n)))
 Force a variable to an n-byte boundary.
 
#define ALIGN4   __attribute__((aligned(4)))
 Force word alignment.
 
#define PACKED   __attribute__((packed))
 Pack aggregate members.
 
#define DEPRECATED   __attribute__((deprecated))
 Deprecated notice.
 
#define INLINE   static inline
 Inline function declarator.
 

Detailed Description

Macro Definition Documentation

◆ ALIGN4

#define ALIGN4   __attribute__((aligned(4)))

Force word alignment.

Note
In the old days, GCC aggregates were always word aligned. In the EABI environment (devkitPro r19 and higher), they are aligned to their widest member. While technically a good thing, it may cause problems for struct-copies. If you have aggregates that can multiples of 4 in size but don't have word members, consider using this attribute to make struct-copies possible again.

◆ DEPRECATED

#define DEPRECATED   __attribute__((deprecated))

Deprecated notice.

Indicates that this function/type/variable should not be used anymore. Replacements are (usually) present somewhere as well.

◆ INLINE

#define INLINE   static inline

Inline function declarator.

‘inline’ inlines the function when -O > 0 when called, but also creates a body for the function itself ‘static’ removes the body as well

◆ PACKED

#define PACKED   __attribute__((packed))

Pack aggregate members.

By default, members in aggregates are aligned to their native boundaries. Adding this prevents that. It will slow access though.