用于 C/C++ Debug 的宏函数

Debug.h

用于打印 Debug 信息的小工具:

c 复制代码
#pragma once

#include <stdio.h>

#define DEBUG 1

#define pn puts("")
#define where printf("%s(%d)-<%s>.\n\n", __FILE__, __LINE__, __FUNCTION__)

#if (DEBUG == 1)
#define print_error(fmt, ...)                                       \
	{                                                        		\
        printf(fmt "some error message.\n", __VA_ARGS__); 			\
        where;                                                      \
    }
#else
#define print_error(fmt, ...) 		\
    {                            	\
        printf(">");             	\
        fflush(stdout);          	\
    }
#endif
相关推荐
时间的情敌17 分钟前
WebGIS + OpenLayers + GeoServer + PostGIS #量算 #点聚合
前端·geoserver·openlayers
kiracrimson31 分钟前
栈与队列容器:适配器、deque 与 priority_queue
开发语言·c++·适配器模式
不可能片场1 小时前
Electron 发布 cookie 库先查明文再写解密
前端·electron
郭小李1 小时前
springmvc 拦截器
java·开发语言·前端
web打印社区1 小时前
Chrome-kiosk-printing能上生产吗
开发语言·前端·javascript·chrome·websocket
白帽攻防录1 小时前
某pc客户端app从xss到rce实战案例
前端·网络安全·黑客·xss·rce·src漏洞·app漏洞
Zwawa1 小时前
从 printf 到曲线:把数据送上 VOFA+
c语言·单片机·嵌入式
志尊宝1 小时前
AI原生前端开发(041):AI辅助的状态管理(Zustand/Pinia)
前端·javascript·ai-native
修炼的dance1 小时前
pngquant 两档质量后接 oxipng,每步省多少花几秒
前端
费曼学习法1 小时前
无人值守AI内容矩阵实战(10):Windows 无 systemd,进程存活率 99% 怎么做
前端