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

José Fonseca jfonseca at vmware.com
Wed Aug 11 04:40:17 PDT 2010


On Tue, 2010-08-10 at 22:57 -0700, Aras Pranckevicius wrote:
>         > 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).

I'm not a lawyer, but my understanding is that if you copy the license
files too, then it should be alright.

I'd personally prefer src/talloc instead of src/glsl/msvc/talloc/ .

> 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

Using C++ is overkill. The solution is simply to use the MSVC inline
keyword (__inline, or something, see p_compiler.h).

>       * 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.

Could you please prepare a patch?

Jose



More information about the mesa-dev mailing list