debug_print_h:c 打印调试的通用接口

时间:2024-07-05 07:38:47
【文件属性】:

文件名称:debug_print_h:c 打印调试的通用接口

文件大小:6KB

文件格式:ZIP

更新时间:2024-07-05 07:38:47

C

我对简单的调试打印宏的一些想法我有,你不必指定类型或 fmt 字符串。 只有一个标题和一个界面。 加上多种颜色中的一种。 完成调试后,只需 CTRL-F 并删除。 要添加您自己的或库类型,只需添加一行 custom_type *: custom_type_to_debug_string, \ 在GET_CREATE_DEBUG_STRING_FUNC宏中 其中custom_type_to_debug_string是具有以下签名的函数: char * custom_type_to_debug_string(void * obj_of_custom_type_v) (您可以在函数内将 obj_of_custom_type_v 转换为 custom_type) 它将指向自定义类型的指针作为 void * 并返回一个动态分配的字符串,其中包含表示自定义类型对象的调试消息。 这适用于 gc


【文件预览】:
debug_print_h-master
----.gitignore(8B)
----Makefile(138B)
----LICENSE(1KB)
----example.c(1KB)
----README.md(2KB)
----debug_print.h(14KB)

网友评论