[Mesa-dev] talloc (Was: Merge criteria for glsl2 branch)
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.
> > http://github.com/aras-p/glsl-optimizer/ ported it to
> 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
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:
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.
> * 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
Could you please prepare a patch?
More information about the mesa-dev