<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>சுதர்சன் சாந்தியப்பன் &#187; ace</title>
	<atom:link href="http://sudarsun.in/blog/tag/ace/feed/" rel="self" type="application/rss+xml" />
	<link>http://sudarsun.in/blog</link>
	<description>Dream of the Impossible™</description>
	<lastBuildDate>Sun, 20 May 2012 17:23:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ACE 5.6.7 does not compile with STLport in Win32 environment</title>
		<link>http://sudarsun.in/blog/2010/06/ace-5-6-7-does-not-compile-with-stlport-in-win32-environment/</link>
		<comments>http://sudarsun.in/blog/2010/06/ace-5-6-7-does-not-compile-with-stlport-in-win32-environment/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 11:56:24 +0000</pubDate>
		<dc:creator>sudarsun</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ace]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[checked_array_iterator]]></category>
		<category><![CDATA[checked_iterator]]></category>
		<category><![CDATA[iterator]]></category>
		<category><![CDATA[stlport]]></category>
		<category><![CDATA[tao]]></category>
		<category><![CDATA[vc8]]></category>
		<category><![CDATA[vc9]]></category>
		<category><![CDATA[win32]]></category>
		<category><![CDATA[_STLP_ITERATOR]]></category>

		<guid isPermaLink="false">http://sudarsun.in/blog/2010/06/ace-5-6-7-does-not-compile-with-stlport-in-win32-environment/</guid>
		<description><![CDATA[ACE 5.6.7 does not compile with STLport in Windows environment (I used vc9 on Windows Server 2008) because of the following header in ACE (ACE_wrappers/ace/checked_iterator.h), which wrongly assumes the existence of stdext::checked_array_iterator in the iterator header.  A PRF is already submitted in the ACE mailing list (http://www.archivum.info/comp.soft-sys.ace/2008-07/00026/%5Bace-users%5D-Checked_iterator.h-problem-with-STLport..html) # if defined (_MSC_VER) &#38;&#38; (_MSC_FULL_VER &#62;= 140050000) [...]]]></description>
			<content:encoded><![CDATA[<p>ACE 5.6.7 does not compile with STLport in Windows environment (I used vc9 on Windows Server 2008) because of the following header in ACE (<em>ACE_wrappers/ace/checked_iterator.h</em>), which wrongly assumes the existence of <span style="font-family: Courier New;">stdext::checked_array_iterator </span>in the <strong><em>iterator</em></strong> header.  A PRF is already submitted in the ACE mailing list (<a href="http://www.archivum.info/comp.soft-sys.ace/2008-07/00026/%5Bace-users%5D-Checked_iterator.h-problem-with-STLport..html" target="_blank">http://www.archivum.info/comp.soft-sys.ace/2008-07/00026/%5Bace-users%5D-Checked_iterator.h-problem-with-STLport..html</a>)</p>
<blockquote><p><span style="font-family: Courier New;"># if defined (_MSC_VER) &amp;&amp; (_MSC_FULL_VER &gt;= 140050000)<br />
// Checked iterators are currently only supported in MSVC++ 8 or better.<br />
#  include &lt;iterator&gt;<br />
# endif  /* _MSC_VER &gt;= 1400 */</span></p>
<p><span style="font-family: Courier New;"># if defined (_MSC_VER) &amp;&amp; (_MSC_FULL_VER &gt;= 140050000)<br />
template &lt;typename PTR&gt;<br />
</span><span style="font-family: Courier New;">stdext::checked_array_iterator&lt;PTR&gt;<br />
ACE_make_checked_array_iterator (PTR buf, size_t len)<br />
{<br />
return stdext::checked_array_iterator  (buf, len);<br />
}<br />
# else<br />
template &lt;typename PTR&gt;<br />
PTR<br />
ACE_make_checked_array_iterator (PTR buf, size_t /* len */)<br />
{<br />
// Checked iterators are unsupported.  Just return the pointer to<br />
// the buffer itself.<br />
return buf;<br />
}<br />
# endif  /* _MSC_VER &gt;= 1400 */</span></p>
<p><span style="font-family: Courier New;">#endif  /* ACE_CHECKED_ITERATOR_H */</span></p></blockquote>
<p>I need to develop a solution to it.  The easiest way to find a solution is to use some macro explicitly set by the STLport header, which is not set by any other STL libraries.  I chose to use the <strong>_STLP_ITERATOR</strong> macro set by &#8220;<em>stl/stlport/iterator</em>&#8221; header.</p>
<blockquote><p><span style="font-family: Courier New;">#ifndef _STLP_ITERATOR<br />
#define _STLP_ITERATOR</span></p>
<p><span style="font-family: Courier New;"># ifndef _STLP_OUTERMOST_HEADER_ID<br />
#  define _STLP_OUTERMOST_HEADER_ID 0&#215;38<br />
#  include &lt;stl/_prolog.h&gt;<br />
# endif</span></p>
<p><span style="font-family: Courier New;"># ifdef _STLP_PRAGMA_ONCE<br />
#  pragma once<br />
# endif</span></p>
<p><span style="font-family: Courier New;">#if defined (_STLP_IMPORT_VENDOR_STD)<br />
# include _STLP_NATIVE_HEADER(iterator)<br />
#endif /* IMPORT */</span></p>
<p><span style="font-family: Courier New;"># ifndef _STLP_INTERNAL_ITERATOR_H<br />
#  include &lt;stl/_iterator.h&gt;<br />
# endif</span></p>
<p><span style="font-family: Courier New;"># ifndef _STLP_INTERNAL_STREAM_ITERATOR_H<br />
#  include &lt;stl/_stream_iterator.h&gt;<br />
# endif</span></p>
<p><span style="font-family: Courier New;"># if (_STLP_OUTERMOST_HEADER_ID == 0&#215;38)<br />
#  include &lt;stl/_epilog.h&gt;<br />
#  undef _STLP_OUTERMOST_HEADER_ID<br />
# endif</span></p>
<p><span style="font-family: Courier New;">#endif /* _STLP_ITERATOR */<br />
</span></p></blockquote>
<p>The solution is the following, where I have added the <em><strong>!defined(_STLP_ITERATOR)</strong></em> condition along with the check for Visual Studio compiler version.</p>
<blockquote><p><span style="font-family: Courier New;"># if <strong>!defined(_STLP_ITERATOR) &amp;&amp;</strong> defined (_MSC_VER) &amp;&amp; (_MSC_FULL_VER &gt;= 140050000)</span><br />
<span style="font-family: Courier New;">// Checked iterators are currently only supported in MSVC++ 8 or better.</span><br />
<span style="font-family: Courier New;">#  include &lt;iterator&gt; </span><br />
<span style="font-family: Courier New;"># endif  /* _MSC_VER &gt;= 1400 */</span></p>
<p><span style="font-family: Courier New;"># if defined (_MSC_VER) &amp;&amp; (_MSC_FULL_VER &gt;= 140050000)</span><br />
<span style="font-family: Courier New;">template &lt;typename PTR&gt;<br />
</span><span style="font-family: Courier New;">stdext::checked_array_iterator </span><span style="font-family: Courier New;">&lt;PTR&gt;</span><br />
<span style="font-family: Courier New;">ACE_make_checked_array_iterator (PTR buf, size_t len)</span><br />
<span style="font-family: Courier New;">{</span><br />
<span style="font-family: Courier New;"> return stdext::checked_array_iterator  (buf, len);</span><br />
<span style="font-family: Courier New;">}</span><br />
<span style="font-family: Courier New;"># else</span><br />
<span style="font-family: Courier New;">template &lt;typename PTR&gt;<br />
</span><span style="font-family: Courier New;">PTR</span><br />
<span style="font-family: Courier New;">ACE_make_checked_array_iterator (PTR buf, size_t /* len */)</span><br />
<span style="font-family: Courier New;">{</span><br />
<span style="font-family: Courier New;"> // Checked iterators are unsupported. Just return the pointer to</span><br />
<span style="font-family: Courier New;"> // the buffer itself.</span><br />
<span style="font-family: Courier New;"> return buf;</span><br />
<span style="font-family: Courier New;">}</span><br />
<span style="font-family: Courier New;">#<br />
endif  /* _MSC_VER &gt;= 1400 */</span></p>
<p><span style="font-family: Courier New;">#endif<br />
/* ACE_CHECKED_ITERATOR_H */</span></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://sudarsun.in/blog/2010/06/ace-5-6-7-does-not-compile-with-stlport-in-win32-environment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  sudarsun.in/blog/tag/ace/feed/ ) in 0.30658 seconds, on May 22nd, 2012 at 2:19 am UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on May 22nd, 2012 at 3:19 am UTC -->
