[Mesa-dev] numeric_limits<float>::infinity() on android

Chad Versace chad.versace at linux.intel.com
Mon Dec 3 11:02:28 PST 2012

On 12/01/2012 08:08 PM, Liu wrote:
> Hi, Chad,
> I notice that you have submitted a fix android build for
> glsl.(5497cc428fa7c6670d252d34f4a67c9498ae3895).  as you pointed out, you
> included "external/astl" and plan to submit the second half fix to upstream.
> what's going on for the second half?
> i update my android astl to the newest, and the numeric_limits<float>::infinity
> is still misssing? further, google dropped external/mesa from official
> repository. does it mean that it won't accept any fix for mesa?
> what's your patch for it? i just copied the definition from GNU stdc++, is it
> right?
> xliu at xliu-desktop:~/Development/android-dev/external/astl$ git diff .
> diff --git a/include/limits b/include/limits
> index 5213a65..df11641 100644
> --- a/include/limits
> +++ b/include/limits
> @@ -110,6 +110,7 @@ struct numeric_limits<float>
>      static float min() { return __FLT_MIN__; }
>      static float max() { return __FLT_MAX__; }
> +    static float infinity() throw() { return __builtin_huge_valf (); }
>      static const bool is_signed = true;
>      static const bool is_integer = false


In ssh://otc-android.intel.com/aosp/platform/external/astl, my fix is in commit

commit 42aa24afc7b3fecc332262ee948ceafc2d9c186e
Author: Chad Versace <chad.versace at linux.intel.com>
Date:   Wed Feb 8 11:20:42 2012 -0800

    Implement numeric_limits::infinty

    This is required by Mesa's GLSL compiler. See
    git://anongit.freedesktop.org/mesa/mesa.git, commit 4f82fed4.

    Signed-off-by: Chad Versace <chad.versace at linux.intel.com>

I've also attached the patch. The just does what you suggest, plus a little
bit more. Your patch looks sufficient to solve Mesa's problem.

It seems that OTC never attempted to push the commit upstream. I need to
follow-up on that.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Implement-numeric_limits-infinty.patch
Type: text/x-patch
Size: 1884 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20121203/7910e445/attachment.bin>

More information about the mesa-dev mailing list