Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-09 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chris Rankin wrote: > --- On Thu, 8/10/09, Brian Paul wrote: >> I think that we could just bracket the call to >> _slang_compile() with the set/restore-locale calls. > > I'd hate to make an obvious suggestion, but... can't you just copy strtod() > c

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-09 Thread Kristian Høgsberg
On Thu, Oct 8, 2009 at 5:47 PM, Ian Romanick wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > The root cause of bug #23308 has been determined to be the use of strtod > in our assembly and GLSL parsers.  When LANG is set to a locale that > changes the radix from "." to, say, ",", float

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-09 Thread Robert Noland
On Fri, 2009-10-09 at 13:06 +0100, José Fonseca wrote: > On Fri, 2009-10-09 at 03:32 -0700, Chris Rankin wrote: > > --- On Fri, 9/10/09, Robert Noland wrote: > > > You can't include GPL code into an MIT project without > > > poluting the license. > > > > Ah. So that means Mesa would need the GLIB

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-09 Thread José Fonseca
On Fri, 2009-10-09 at 03:32 -0700, Chris Rankin wrote: > --- On Fri, 9/10/09, Robert Noland wrote: > > You can't include GPL code into an MIT project without > > poluting the license. > > Ah. So that means Mesa would need the GLIBC copyright holder's explicit > permission ... That would be Uli D

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-09 Thread Chris Rankin
--- On Fri, 9/10/09, Robert Noland wrote: > You can't include GPL code into an MIT project without > poluting the license. Ah. So that means Mesa would need the GLIBC copyright holder's explicit permission ... That would be Uli Drepper, presumably. Cheers, Chris -

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-09 Thread Robert Noland
On Fri, 2009-10-09 at 01:03 -0700, Chris Rankin wrote: > --- On Thu, 8/10/09, Brian Paul wrote: > > I think that we could just bracket the call to > > _slang_compile() with the set/restore-locale calls. > > I'd hate to make an obvious suggestion, but... can't you just copy strtod() > code (witho

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-09 Thread Chris Rankin
--- On Thu, 8/10/09, Brian Paul wrote: > I think that we could just bracket the call to > _slang_compile() with the set/restore-locale calls. I'd hate to make an obvious suggestion, but... can't you just copy strtod() code (without the locale support) from GLIBC? My basic research suggests that

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-08 Thread Eric Anholt
On Thu, 2009-10-08 at 16:32 -0600, Brian Paul wrote: > Chris Rankin wrote: > > --- On Thu, 8/10/09, tom fogal wrote: > >> What about > >> > >> char *lang = getenv("LANG"); > >> setenv("LANG", "POSIX", 1); > >> strtod(...); > >> setenv("LANG", lang, 1); > >> > >> i.e. push / pop the LANG va

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-08 Thread Chris Rankin
--- On Thu, 8/10/09, Brian Paul wrote: > I think that we could just bracket the call to > _slang_compile() with the set/restore-locale calls. Is that wise? Does multi-threaded behaviour matter here? I think the locale is global. "The strtod() and atof() functions can be used safely in multithre

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-08 Thread Brian Paul
Chris Rankin wrote: > --- On Thu, 8/10/09, tom fogal wrote: >> What about >> >> char *lang = getenv("LANG"); >> setenv("LANG", "POSIX", 1); >> strtod(...); >> setenv("LANG", lang, 1); >> >> i.e. push / pop the LANG value? > > The neater way to implement that solution would be to use > >

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-08 Thread Chris Rankin
--- On Thu, 8/10/09, tom fogal wrote: > What about > >   char *lang = getenv("LANG"); >   setenv("LANG", "POSIX", 1); >   strtod(...); >   setenv("LANG", lang, 1); > > i.e. push / pop the LANG value? The neater way to implement that solution would be to use char *oldLocale = setlocale(LC_NUMER

Re: [Mesa3d-dev] Importing "real" strtod code

2009-10-08 Thread tom fogal
Ian Romanick writes: > The root cause of bug #23308 has been determined to be the use of > strtod in our assembly and GLSL parsers. When LANG is set to a > locale that changes the radix from "." to, say, ",", floating point > numbers are not parsed correctly. > > It seems that the correct fix is

[Mesa3d-dev] Importing "real" strtod code

2009-10-08 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 The root cause of bug #23308 has been determined to be the use of strtod in our assembly and GLSL parsers. When LANG is set to a locale that changes the radix from "." to, say, ",", floating point numbers are not parsed correctly. It seems that the c