用于 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
相关推荐
Sirens.4 分钟前
Java并发锁详解:六类锁策略与 synchronized 底层原理
java·前端·算法
会员果汁1 小时前
函数调用和变长参数
c语言
特创数字科技1 小时前
一个纯本地运行的图片处理工具:压缩 / 裁剪 / 九宫格 / 圆角 / 滤镜 / 拼图 / 水印,终生使用
前端
IT_陈寒2 小时前
Vue的v-if和v-for混用居然是个天坑
前端·人工智能·后端
xailorliu2 小时前
SLIC_超像素算法
c++·opencv·目标检测·机器学习·计算机视觉
天衍四九-2 小时前
【无标题】
前端·spring boot·mysql·nginx·docker
广州华水科技2 小时前
2026年单北斗GNSS变形监测系统推荐榜单,解锁GNSS位移监测新高度
前端
苏打豆2 小时前
CRISP源码阅读——基于ROS2力矩反馈控制器与速度加速度零空间
c++·线性代数·算法·矩阵·机器人
xcyxiner2 小时前
DicomViewer24 修复编译bug(window test 失败)
前端·qt