[Mesa-stable] [Mesa-dev] [PATCH 19/29] glsl: Don't use strtod_l in Mesa on Android.

Emil Velikov emil.l.velikov at gmail.com
Fri Aug 1 08:15:33 PDT 2014


On 30/07/14 05:30, Ian Romanick wrote:
> I think we should replace all the #ifdef garbage around this with a
> HAVE_STRTOD_L macro.  Having lots of platform knowledge sprinkled around
> the code is ugly, at best.
> 
Asking for the last guy to refactor it because the previous N people before
him did not bother sounds a bit mean IMHO :'(

With that aside I cannot reproduce the issue on my Android builds so I'm
guessing that it is a bug in the NDK and/or is specific to the Chromium
builds. As such I'm going to drop the patch unless Myles comes forward and
addresses Ian's concerns.

-Emil

> Also... doesn't strtof_l (later in strtod.c) need the same treatment?
> 
> On 07/29/2014 03:54 PM, Emil Velikov wrote:
>> From: "Myles C. Maxfield" <mymax at amazon.com>
>>
>> Android includes a fix to asm/posix_types.h inside
>> /ndk/toolchains/x86-4.7/prebuilt/linux-x86_64/lib/gcc/
>> i686-linux-android/4.7/include-fixed/asm/posix_types.h. That
>> file #include_next's the real asm/posix_types.h, but then fixes
>> (redefines) the __FD_ZERO macro. However, it also #includes
>> features.h, which unconditionally defines _GNU_SOURCE.
>> src/glsl/strtod.c assumes that if the _GNU_SOURCE macro is defined,
>> that it can use locale_t, which isn't available on Android.
>>
>> Review URL: https://chromiumcodereview.appspot.com/18594002
>>
>> Patch pulled from the chromium project
>> https://android.googlesource.com/platform/external/chromium_org/third_party/mesa/src/+/2a3406721cd61852bebd502c7a907cf07b7be731%5E%21
>>
>> Cc: "10.1 10.2" <mesa-stable at lists.freedesktop.org>
>> ---
>>  src/glsl/strtod.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/glsl/strtod.c b/src/glsl/strtod.c
>> index 5d4346b..ddc5564 100644
>> --- a/src/glsl/strtod.c
>> +++ b/src/glsl/strtod.c
>> @@ -45,7 +45,7 @@ double
>>  glsl_strtod(const char *s, char **end)
>>  {
>>  #if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
>> -   !defined(__HAIKU__) && !defined(__UCLIBC__)
>> +   !defined(__HAIKU__) && !defined(__UCLIBC__) && !defined(ANDROID)
>>     static locale_t loc = NULL;
>>     if (!loc) {
>>        loc = newlocale(LC_CTYPE_MASK, "C", NULL);
>>
> 



More information about the mesa-stable mailing list