<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Three deficiencies in the C# preprocessor</title>
	<atom:link href="http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/feed/" rel="self" type="application/rss+xml" />
	<link>http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/</link>
	<description>The blogged wandering of Robert W. Anderson</description>
	<lastBuildDate>Mon, 20 Jun 2011 16:33:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Expert Texture &#187; Perils of #define</title>
		<link>http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/comment-page-1/#comment-190282</link>
		<dc:creator>Expert Texture &#187; Perils of #define</dc:creator>
		<pubDate>Fri, 09 Jan 2009 17:19:38 +0000</pubDate>
		<guid isPermaLink="false">http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/#comment-190282</guid>
		<description>[...] couple of years ago, I wrote Three deficiencies in the C# preprocessor.  Those issues still exist, but a good thing about C# is you don&#8217;t get the following problem [...]</description>
		<content:encoded><![CDATA[<p>[...] couple of years ago, I wrote Three deficiencies in the C# preprocessor.  Those issues still exist, but a good thing about C# is you don&#8217;t get the following problem [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Reinier Post</title>
		<link>http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/comment-page-1/#comment-136299</link>
		<dc:creator>Reinier Post</dc:creator>
		<pubDate>Fri, 19 Oct 2007 12:19:50 +0000</pubDate>
		<guid isPermaLink="false">http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/#comment-136299</guid>
		<description>(Sorry, retry.)

I *am* using this, but in VB:

  #If VBC_VER *lt; 8.0 Then

I came here Googling for the name of the corresponding variable in C#.
(Other people do write code in C#.)  Can&#039;t find anything on MSDN.

(It&#039;s small things like these that make me prefer VB.)</description>
		<content:encoded><![CDATA[<p>(Sorry, retry.)</p>
<p>I *am* using this, but in VB:</p>
<p>  #If VBC_VER *lt; 8.0 Then</p>
<p>I came here Googling for the name of the corresponding variable in C#.<br />
(Other people do write code in C#.)  Can&#8217;t find anything on MSDN.</p>
<p>(It&#8217;s small things like these that make me prefer VB.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert W. Anderson</title>
		<link>http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/comment-page-1/#comment-39464</link>
		<dc:creator>Robert W. Anderson</dc:creator>
		<pubDate>Thu, 15 Jun 2006 15:16:58 +0000</pubDate>
		<guid isPermaLink="false">http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/#comment-39464</guid>
		<description>Actually, no, I meant &quot;write another&quot;.  I meant something very simplistic that, in my case, would simple remove lines with &lt;strong&gt;#pragma warning&lt;/strong&gt;.  I don&#039;t think the C++ pre-processor would do well for this, but maybe it would work.

I didn&#039;t really go into detail on how we do cross-compilation:  there is a post-build step run from VS2005 that calls &lt;strong&gt;nant&lt;/strong&gt; that in turn invokes a build for .NET 1.1 from the command-line.  This is where hte __DOTNET11__ constant is defined, &lt;em&gt;not&lt;/em&gt; in the C# source code.

I actually don&#039;t like the multi-configuration idea: I want both builds every time.

Cheers.

</description>
		<content:encoded><![CDATA[<p>Actually, no, I meant &#8220;write another&#8221;.  I meant something very simplistic that, in my case, would simple remove lines with <strong>#pragma warning</strong>.  I don&#8217;t think the C++ pre-processor would do well for this, but maybe it would work.</p>
<p>I didn&#8217;t really go into detail on how we do cross-compilation:  there is a post-build step run from VS2005 that calls <strong>nant</strong> that in turn invokes a build for .NET 1.1 from the command-line.  This is where hte __DOTNET11__ constant is defined, <em>not</em> in the C# source code.</p>
<p>I actually don&#8217;t like the multi-configuration idea: I want both builds every time.</p>
<p>Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: w7</title>
		<link>http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/comment-page-1/#comment-38820</link>
		<dc:creator>w7</dc:creator>
		<pubDate>Thu, 15 Jun 2006 07:17:56 +0000</pubDate>
		<guid isPermaLink="false">http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/#comment-38820</guid>
		<description>Thanks for your feedback, Robert. #2 should simply read &quot;use another...&quot;, not &quot;write another...&quot;. You should be able to use the standard C/C++ preprocessor as a pre-build step, but I am not totally sure if the C# project can be configed in that way. 

With regards to my issue, your suggestions are gratefully received but don&#039;t quite do the trick for me (it&#039;s the same source code, so I cannot define one macro in one source file and another in the second). I guess I&#039;ll follow somebody else&#039;s recommendation to create different build configurations (&quot;Release .NET 2&quot;, &quot;Release .NET 1.1&quot;, etc), and instruct people to use the correct ones.</description>
		<content:encoded><![CDATA[<p>Thanks for your feedback, Robert. #2 should simply read &#8220;use another&#8230;&#8221;, not &#8220;write another&#8230;&#8221;. You should be able to use the standard C/C++ preprocessor as a pre-build step, but I am not totally sure if the C# project can be configed in that way. </p>
<p>With regards to my issue, your suggestions are gratefully received but don&#8217;t quite do the trick for me (it&#8217;s the same source code, so I cannot define one macro in one source file and another in the second). I guess I&#8217;ll follow somebody else&#8217;s recommendation to create different build configurations (&#8220;Release .NET 2&#8243;, &#8220;Release .NET 1.1&#8243;, etc), and instruct people to use the correct ones.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert W. Anderson</title>
		<link>http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/comment-page-1/#comment-38442</link>
		<dc:creator>Robert W. Anderson</dc:creator>
		<pubDate>Thu, 15 Jun 2006 03:24:45 +0000</pubDate>
		<guid isPermaLink="false">http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/#comment-38442</guid>
		<description>Thanks for the comment.
For cross-compilation, we define a __DOTNET11__ constant in the .NET 1.1 projects.  That works OK, aside from my desire to use the new #pragma statement.  If you need to get around new preprocessor commands, then the choices become kind of heinous:
1. Encapsulate the new code in .NET-version specific files.
2. Write another pre-processor (or filter out invalid pre-processor statements using regexs).
I&#039;ve done #1 in a couple of cases, and will probably do #2 as we get closer to our next release.
Cheers,
Robert</description>
		<content:encoded><![CDATA[<p>Thanks for the comment.<br />
For cross-compilation, we define a __DOTNET11__ constant in the .NET 1.1 projects.  That works OK, aside from my desire to use the new #pragma statement.  If you need to get around new preprocessor commands, then the choices become kind of heinous:<br />
1. Encapsulate the new code in .NET-version specific files.<br />
2. Write another pre-processor (or filter out invalid pre-processor statements using regexs).<br />
I&#8217;ve done #1 in a couple of cases, and will probably do #2 as we get closer to our next release.<br />
Cheers,<br />
Robert</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: w7</title>
		<link>http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/comment-page-1/#comment-38021</link>
		<dc:creator>w7</dc:creator>
		<pubDate>Wed, 14 Jun 2006 18:58:02 +0000</pubDate>
		<guid isPermaLink="false">http://rwandering.net/2006/06/08/three-deficiencies-in-the-c-preprocessor/#comment-38021</guid>
		<description>Signed, approved, agreed. 
What is your recommendation re/ the __CLR_VER issue? I have C# code that needs compiling in VS .NET 2003 and VS .NET 2005, where the latter requires a few tweaks, so I&#039;d like to use conditional compilation just in the very way that you indicated won&#039;t work with the C# preprocessor.</description>
		<content:encoded><![CDATA[<p>Signed, approved, agreed.<br />
What is your recommendation re/ the __CLR_VER issue? I have C# code that needs compiling in VS .NET 2003 and VS .NET 2005, where the latter requires a few tweaks, so I&#8217;d like to use conditional compilation just in the very way that you indicated won&#8217;t work with the C# preprocessor.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

