<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">&gt; No, it&#39;s missing most of the API that talloc provides.  Also,<br>
&gt; <a href="http://github.com/aras-p/glsl-optimizer/" target="_blank">http://github.com/aras-p/glsl-optimizer/</a> ported it to windows.<br>
Could then Aras Pranckevicius&#39;s talloc port to windows be merged into<br>
glsl2 branch before glsl2 is merged into master?</blockquote><div><br></div><div>First things first: I needed to make it compile &amp; work quickly, so I just dropped talloc.h and talloc.c into my project (<a href="http://github.com/aras-p/glsl-optimizer/tree/glsl2/src/glsl/msvc/talloc/">http://github.com/aras-p/glsl-optimizer/tree/glsl2/src/glsl/msvc/talloc/</a>) and made some fixes. So I wouldn&#39;t call it a &quot;full port&quot;, but apparently it was enough without taking everything that is in official talloc tarball. However, I&#39;m not really sure if that is &quot;legal&quot; license wise (talloc is LGPLv3).</div>
<div><br></div><div>That said, the only fixes I had to do are Visual C++ specific (I&#39;m using VS2008):</div><div><ul><li>compile talloc.c as C++ (otherwise &#39;inline&#39; etc. are errors on MSVC). This required wrapping talloc.h and talloc.c in extern &quot;C&quot; blocks: <a href="http://github.com/aras-p/glsl-optimizer/commit/ceee99ebe0c606de6ed093c2aec20f8ecae5b673">http://github.com/aras-p/glsl-optimizer/commit/ceee99ebe0c606de6ed093c2aec20f8ecae5b673</a></li>
<li>vsnprintf can&#39;t be used to determine output buffer size; under MSVC _vcsprintf has to be used instead. <a href="http://github.com/aras-p/glsl-optimizer/commit/56bb0c7e7cedefcd2d149011a0b644551e080b9a">http://github.com/aras-p/glsl-optimizer/commit/56bb0c7e7cedefcd2d149011a0b644551e080b9a</a></li>
<li>Replaced usage of MIN to TALLOC_MIN, and defined TALLOC_MIN: <a href="http://github.com/aras-p/glsl-optimizer/commit/db96499fbf874582b81dabedebc835c950520211">http://github.com/aras-p/glsl-optimizer/commit/db96499fbf874582b81dabedebc835c950520211</a> (there&#39;s accidental line of unrelated change in that commit)</li>
</ul></div></div>Compiling on Mac with Xcode 3.2 (using gcc 4.0) required MIN-&gt;TALLOC_MIN change and compiling as C++ with extern &quot;C&quot; blocks as well.<br clear="all"><br>-- <br>Aras Pranckevičius<br>work: <a href="http://unity3d.com">http://unity3d.com</a><br>
home: <a href="http://aras-p.info">http://aras-p.info</a><br>
<div><br></div>