<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">> No, it's missing most of the API that talloc provides. Also,<br>
> <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'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 & 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't call it a "full port", but apparently it was enough without taking everything that is in official talloc tarball. However, I'm not really sure if that is "legal" license wise (talloc is LGPLv3).</div>
<div><br></div><div>That said, the only fixes I had to do are Visual C++ specific (I'm using VS2008):</div><div><ul><li>compile talloc.c as C++ (otherwise 'inline' etc. are errors on MSVC). This required wrapping talloc.h and talloc.c in extern "C" 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'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'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->TALLOC_MIN change and compiling as C++ with extern "C" 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>