用于 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
相关推荐
jt君424261 小时前
React Native JSI 深入剖析 — 第 5 部分中文技术整理:用 HostObject 把 C++ 类暴露给 JavaScript
前端·react native
胡萝卜术1 小时前
滑动窗口最大值:从暴力到单调队列,层层优化全解析
前端·javascript·面试
fluffyox1 小时前
Notion 的公式栏里,藏着一台虚拟机——逆向 + 用 600 行 JS 复刻它的编译器与栈式 VM
前端
kyriewen2 小时前
2026 年了,这 6 个 npm 包可以卸载了——浏览器原生 API 已经能替代
前端·javascript·npm
Csvn5 小时前
Monorepo 迁移血泪史:从 Multi-Repo 到 Turborepo,这 3 个坑我帮你踩完了
前端
星栈5 小时前
Dioxus 多页面怎么做:`dioxus-router`、嵌套路由、`Outlet` 和页面组织,一篇给你讲顺
前端·rust·前端框架
用户987409238875 小时前
用 Remotion + edge-tts 打造中文教学视频全自动流水线
前端
风骏时光牛马5 小时前
Less前端工程化实战:变量混合器与项目样式分层落地
前端
假如让我当三天老蒯5 小时前
Options API(选项式 API) 和 Composition API(组合式 API)
前端·vue.js·面试
SameX5 小时前
iOS 独立开发实践:用 MapKit + 像素渲染实现 Citywalk 轨迹地图 App「雁过留痕」
前端