<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://vegard.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=is_set%28%29</id>
	<title>is set() - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://vegard.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=is_set%28%29"/>
	<link rel="alternate" type="text/html" href="http://vegard.wiki/mediawiki/index.php?title=is_set()&amp;action=history"/>
	<updated>2026-07-04T15:52:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>http://vegard.wiki/mediawiki/index.php?title=is_set()&amp;diff=231&amp;oldid=prev</id>
		<title>Vegard: new page</title>
		<link rel="alternate" type="text/html" href="http://vegard.wiki/mediawiki/index.php?title=is_set()&amp;diff=231&amp;oldid=prev"/>
		<updated>2020-03-01T11:56:38Z</updated>

		<summary type="html">&lt;p&gt;new page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:is_set()}}&lt;br /&gt;
The following macro checks if another macro is set to 1 and works both in &amp;lt;code&amp;gt;#if&amp;lt;/code&amp;gt; preprocessor expressions and in actual C code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;C&amp;quot;&amp;gt;&lt;br /&gt;
// https://stackoverflow.com/a/10119699/1697183&lt;br /&gt;
// https://news.ycombinator.com/item?id=3830609&lt;br /&gt;
// https://github.com/torvalds/linux/commit/69349c2dc01c489eccaa4c472542c08e370c6d7e&lt;br /&gt;
#define is_set(macro) is_set_(macro)&lt;br /&gt;
#define macrotest_1 ,&lt;br /&gt;
#define is_set_(value) is_set__(macrotest_##value)&lt;br /&gt;
#define is_set__(comma) is_set___(comma 1, 0)&lt;br /&gt;
#define is_set___(_, v, ...) v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:C]]&lt;br /&gt;
[[Category:Programming]]&lt;br /&gt;
[[Category:C preprocessor snippets]]&lt;/div&gt;</summary>
		<author><name>Vegard</name></author>
	</entry>
</feed>