[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 (
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

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

   - compile talloc.c as C++ (otherwise 'inline' etc. are errors on MSVC).
   This required wrapping talloc.h and talloc.c in extern "C" blocks:
   - vsnprintf can't be used to determine output buffer size; under MSVC
   _vcsprintf has to be used instead.
   - Replaced usage of MIN to TALLOC_MIN, and defined TALLOC_MIN:
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