XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_attr.h
浏览该文件的文档.
1
12#ifndef __XF_ATTR_H__
13#define __XF_ATTR_H__
14
15/* ==================== [Includes] ========================================== */
16
17#include "xf_common_config.h"
18
28#ifdef __cplusplus
29extern "C" {
30#endif
31
32/* ==================== [Defines] =========================================== */
33
39#if XF_ATTRIBUTE_IS_ENABLE
40
41#if defined(__GNUC__)
42# if !defined(__weak)
48# define __weak __attribute__((weak))
49# endif
50#else
51# define __weak
52#endif
53
54#if defined(__GNUC__)
55# if !defined(__used)
60# define __used __attribute__((used))
61# endif
62#else
63# define __used
64#endif
65
66#if defined(__GNUC__)
67# if !defined(__aligned)
73# define __aligned(x) __attribute__((aligned(x)))
74# endif
75#else
76# define __aligned(x)
77# warning "__aligned has no effect !"
78#endif
79
80#if defined(__GNUC__)
81# if !defined(__section)
87# define __section(x) __attribute__((section(x)))
88# endif
89#else
90# define __section(x)
91#endif
92
93#if defined(__GNUC__)
94# if !defined(likely)
100# define likely(x) __builtin_expect(!!(x), 1)
101# endif
102#else
103# define likely(x) (x)
104#endif
105
106#if defined(__GNUC__)
107# if !defined(unlikely)
113# define unlikely(x) __builtin_expect(!!(x), 0)
114# endif
115#else
116# define unlikely(x) (x)
117#endif
118
119#if defined(__GNUC__)
120# if !defined(__packed)
124# define __packed __attribute__((packed))
125# endif
126#else
127# define __packed
128# warning "__packed has no effect !"
129#endif
130
131#endif // XF_ATTRIBUTE_IS_ENABLE
132
133/* ==================== [Global Prototypes] ================================= */
134
135/* ==================== [Macros] ============================================ */
136
137#ifdef __cplusplus
138} /*extern "C"*/
139#endif
140
146#endif /* __XF_ATTR_H__ */
预定义. xf_attr.h 等头文件通过包含本文件减少对其余外部文件的直接依赖. 如: xfconfig.h.