My Project
Loading...
Searching...
No Matches
annotations.h
Go to the documentation of this file.
1#ifndef X86_ANNOTATIONS_H
2#define X86_ANNOTATIONS_H
3
4// Annotations (and macros) for documentation, and potential future analyzing.
5
6// Parameter Annotations
7#define IN // Takes REQUIRED INPUT
8#define OUT // Supplies REQUIRED OUTPUT
9#define _In_Opt // Takes OPTIONAL INPUT if given.
10#define _Out_Opt // OPTIONALLY Supplies OUTPUT if given.
11
12// Function will not return.
13#define NORETURN __attribute__((noreturn))
14
15// Function will be forcefully inlined by the compiler.
16#ifndef FORCEINLINE
17#if defined(__clang__) || defined(__GNUC__)
18#define FORCEINLINE static inline __attribute__((always_inline))
19#elif defined(_MSC_VER)
20#define FORCEINLINE static __forceinline
21#else
22#define FORCEINLINE static inline
23#endif
24#endif
25
26// Function will be forcefully inlined by the compiler. (between translation files)
27#ifndef FORCEINLINE_NOHEADER
28#if defined(__clang__) || defined(__GNUC__)
29#define FORCEINLINE_NOHEADER __attribute__((always_inline))
30#elif defined(_MSC_VER)
31#define FORCEINLINE_NOHEADER __forceinline
32#else
33#define FORCEINLINE_NOHEADER inline
34#endif
35#endif
36
37// Function / Object is signaled as used, even though it is not used in any translation unit.
38#define USED __attribute__((used))
39
40#endif