KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Various common macros used throughout the codebase. More...
#include <sys/cdefs.h>
Go to the source code of this file.
Macros | |
#define | __noreturn __attribute__((__noreturn__)) |
Identify a function that will never return. | |
#define | __pure __attribute__((__const__)) |
Identify a function that has no side effects other than its return, and only uses its arguments for any work. | |
#define | __unused __attribute__((__unused__)) |
Identify a function or variable that may be unused. | |
#define | __used __attribute__((used)) |
Prevent a symbol from being removed from the binary. | |
#define | __weak __attribute__((weak)) |
Identify a function or variable that may be overridden by another symbol. | |
#define | __packed __attribute__((packed)) |
Force a structure, enum, or other type to be packed as small as possible. | |
#define | __dead2 __noreturn /* BSD compat */ |
Alias for __noreturn. | |
#define | __pure2 __pure /* ditto */ |
Alias for __pure. | |
#define | __likely(exp) __builtin_expect(!!(exp), 1) |
Directive to inform the compiler the condition is in the likely path. | |
#define | __unlikely(exp) __builtin_expect(!!(exp), 0) |
Directive to inform the compiler the condition is in the unlikely path. | |
#define | __deprecated __attribute__((deprecated)) |
Mark something as deprecated. | |
#define | __printflike(fmtarg, firstvararg) __attribute__((__format__ (__printf__, fmtarg, firstvararg))) |
Identify a function as accepting formatting like printf(). | |
#define | __scanflike(fmtarg, firstvararg) __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) |
Identify a function as accepting formatting like scanf(). | |
#define | __fallthrough /* Fall through */ |
#define | __always_inline inline __attribute__((__always_inline__)) |
Ask the compiler to always inline a given function. | |
#define | __no_inline __attribute__((__noinline__)) |
Ask the compiler to never inline a given function. | |
#define | __RESTRICT |
#define | __extension__ |
#define | inline __inline__ |
#define | __build_assert(cond) do { (void) sizeof(char [1 - 2*!(cond)]); } while(0) |
Assert a build-time dependency. | |
#define | __build_assert_or_zero(cond) (sizeof(char [1 - 2*!(cond)]) - 1) |
Assert a build-time dependency. | |
#define | __array_size(arr) (sizeof(arr) / sizeof((arr)[0]) + _array_size_chk(arr)) |
Get the number of elements in a visible array. | |
#define | _array_size_chk(arr) 0 |
Various common macros used throughout the codebase.
This file contains various convenience macros. Mostly compiler attribute directives, as well as other language defines, and useful language extensions.