XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_predef.h 文件参考

预定义宏. 更多...

#include "xf_common_config.h"
xf_predef.h 的引用(Include)关系图:

浏览源代码.

宏定义

#define __FILENAME__
 获取不含路径的文件名。
 
#define NC   (-1)
 空引脚值。当引脚无需使用时填入。
 
#define UNUSED(x)   do { (void)(x); } while(0)
 未使用的变量通过 UNUSED 防止编译器警告。
 
#define CONCAT(a, b)   a##b
 拼接。
 
#define CONCAT3(a, b, c)   a##b##c
 拼接 3 个参数。
 
#define XCONCAT(a, b)   CONCAT(a, b)
 展开拼接。 与 CONCAT 相比,此宏会先展开宏后拼接。
 
#define XCONCAT3(a, b, c)   CONCAT3(a, b, c)
 展开拼接 3 个参数。 与 CONCAT3 相比,此宏会先展开宏后拼接。
 
#define STR(x)   #x
 字符串化。 见:https://gcc.gnu.org/onlinedocs/gcc-3.4.3/cpp/Stringification.html
 
#define XSTR(x)   STR(x)
 参数字符串化。 见:https://gcc.gnu.org/onlinedocs/gcc-3.4.3/cpp/Stringification.html
 
#define xf_offsetof(type, member)   ((size_t)&((type *)0)->member)
 xf_offsetof - 返回结构成员相对于结构开头的字节偏移量。
 
#define xf_container_of(ptr, type, member)    ((type *)((char *)(ptr) - xf_offsetof(type, member)))
 xf_container_of - 通过结构体成员变量地址获取结构体的地址.
 
#define ARRAY_SIZE(arr)   (sizeof(arr) / sizeof((arr)[0]))
 ARRAY_SIZE - 获取数组 arr 中的元素数量。
 

详细描述

预定义宏.

作者
catcatBlue (catca.nosp@m.tblu.nosp@m.e@qq..nosp@m.com)
版本
1.0
日期
2024-06-19

Copyright (c) 2024, CorAL. All rights reserved.

在文件 xf_predef.h 中定义.