<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Macro on Tony Bai</title><link>https://tonybai.com/tags/macro/</link><description>Recent content in Macro on Tony Bai</description><generator>Hugo</generator><language>zh-cn</language><copyright>2004-2026 Tony Bai. 版权所有.</copyright><lastBuildDate>Mon, 27 May 2024 00:00:00 +0800</lastBuildDate><atom:link href="https://tonybai.com/tags/macro/index.xml" rel="self" type="application/rss+xml"/><item><title>Gopher的Rust第一课：第一个Rust程序</title><link>https://tonybai.com/2024/05/27/gopher-rust-first-lesson-first-rust-program/</link><pubDate>Mon, 27 May 2024 00:00:00 +0800</pubDate><guid>https://tonybai.com/2024/05/27/gopher-rust-first-lesson-first-rust-program/</guid><description>本文永久链接 – https://tonybai.com/2024/05/27/gopher-rust-first-lesson-first-rust-program 经过上一章的学习，我想现在你已经成功安装好一个Rust开发环境了，是时候撸起袖子开始写Rust代码了！ 程序员这个历史并不算悠久的行当，却有着一个历史悠久的传统，那就是每种编程语言都将一个名为“hello, world”的示例作为这...</description></item><item><title>Recommended C Style and Coding Standards中文版全文</title><link>https://tonybai.com/2013/11/26/the-full-text-of-recommended-c-style-and-coding-standards/</link><pubDate>Tue, 26 Nov 2013 00:00:00 +0800</pubDate><guid>https://tonybai.com/2013/11/26/the-full-text-of-recommended-c-style-and-coding-standards/</guid><description>今天无意中打开了托管在Google Code上的“Recommended C Style and Coding Standards”翻译项目，忽感觉通过目录链接的方式查看译文缺少整体感，于是花了点时间将译文全文以single page的形式贴在博客里面，方便大家查看，也算是对该翻译内容的一个备份吧。 **C语言编码风格和标准** **0\. 摘要** 本文翻译自《Recommended C Sty...</description></item><item><title>当可执行程序版本信息变更时</title><link>https://tonybai.com/2011/09/09/when-program-version-changed/</link><pubDate>Fri, 09 Sep 2011 00:00:00 +0800</pubDate><guid>https://tonybai.com/2011/09/09/when-program-version-changed/</guid><description>在Unix/Linux上，我们一般可以通过两种方法查看到一个可执行程序的版本信息，以下以Ubuntu中的Gcc为例。 第一种方法：我们可以直接通过程序名字得到版本信息，例如: $ which gcc /usr/bin/gcc $ ls -l /usr/bin/gcc lrwxrwxrwx 1 root root 7 2010-08-21 00:18 /usr/bin/gcc -&amp;gt; gcc-4.4\...</description></item><item><title>关于宏定义切换以及屏蔽的例子</title><link>https://tonybai.com/2008/05/17/examples-for-macro-definition-switch-and-mask/</link><pubDate>Sat, 17 May 2008 00:00:00 +0800</pubDate><guid>https://tonybai.com/2008/05/17/examples-for-macro-definition-switch-and-mask/</guid><description>assert是大家常用的宏，它的用法相信大家都有所了解。P.J Plauger的&amp;#34;The C Standard Library&amp;#34;一书中提到在源代码中切换assert宏定义的方法： /\* turn assertion on \*/ #undef NDEBUG #include /\* turn assertions off \*/ #define NDEBUG #include 我顺手写了一个例子...</description></item><item><title>多行宏定义中的注释问题</title><link>https://tonybai.com/2008/03/14/the-problems-of-commenting-multiple-lines-macro/</link><pubDate>Fri, 14 Mar 2008 00:00:00 +0800</pubDate><guid>https://tonybai.com/2008/03/14/the-problems-of-commenting-multiple-lines-macro/</guid><description>早上在写代码时遇到这样一个问题：即如何在一个拥有多行的宏定义中做注释？，这里把方法演化的过程贴出来，可能对某些朋友有些借鉴意义。 宏定义高深莫测，而且是比较细节的东西，详细说明请参见&amp;#34;C参考手册&amp;#34;之类的书籍。 在我的代码中，我大致要做这样一个简单的事情：printf(&amp;#34;%s%s%s\\n&amp;#34;, &amp;#34;hello&amp;#34;, &amp;#34;macro&amp;#34;, &amp;#34;yeah!&amp;#34;); &amp;#34;%s%s%s\\n&amp;#34;这个字符串中每一项输出都有一...</description></item><item><title>你提供默认选项了吗</title><link>https://tonybai.com/2006/05/08/supply-the-default-option/</link><pubDate>Mon, 08 May 2006 00:00:00 +0800</pubDate><guid>https://tonybai.com/2006/05/08/supply-the-default-option/</guid><description>五一期间到姥姥家串门儿，自然午饭要在那吃，可中午做饭时听姥姥抱怨新买的电饭煲做饭时间太长而且还夹生，我好奇的走了过去想看看究竟，电饭煲的确是新买不久的，而且是美的的，我心想大牌厂商应该不会有这样的质量问题呀，一定是姥姥使用上的问题。仔细看了看控制板，果然不出所料，电饭煲的’功能选择’键停在了功能档的中央，既不是左边的’煮饭’也不是右边的’煲粥’，遂告诉姥姥以后煮饭要把功能选择调到’煮饭’档。 吃完...</description></item></channel></rss>