[Mesa-dev] talloc (Was: Merge criteria for glsl2 branch)

Aras Pranckevicius aras at unity3d.com
Tue Aug 10 22:57:16 PDT 2010


>
> > No, it's missing most of the API that talloc provides.  Also,
> > http://github.com/aras-p/glsl-optimizer/ ported it to windows.
> Could then Aras Pranckevicius's talloc port to windows be merged into
> glsl2 branch before glsl2 is merged into master?


First things first: I needed to make it compile & work quickly, so I just
dropped talloc.h and talloc.c into my project (
http://github.com/aras-p/glsl-optimizer/tree/glsl2/src/glsl/msvc/talloc/)
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).

That said, the only fixes I had to do are Visual C++ specific (I'm using
VS2008):

   - compile talloc.c as C++ (otherwise 'inline' etc. are errors on MSVC).
   This required wrapping talloc.h and talloc.c in extern "C" blocks:
   http://github.com/aras-p/glsl-optimizer/commit/ceee99ebe0c606de6ed093c2aec20f8ecae5b673
   - vsnprintf can't be used to determine output buffer size; under MSVC
   _vcsprintf has to be used instead.
   http://github.com/aras-p/glsl-optimizer/commit/56bb0c7e7cedefcd2d149011a0b644551e080b9a
   - Replaced usage of MIN to TALLOC_MIN, and defined TALLOC_MIN:
   http://github.com/aras-p/glsl-optimizer/commit/db96499fbf874582b81dabedebc835c950520211(there's
accidental line of unrelated change in that commit)

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.

-- 
Aras Pranckevičius
work: http://unity3d.com
home: http://aras-p.info
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20100811/c996f847/attachment.htm>


More information about the mesa-dev mailing list