[Mesa-dev] [PATCH] glsl: Fix isinf() for non-C99-compliant compilers.
Kenneth Graunke
kenneth at whitecape.org
Wed Jan 18 15:33:51 PST 2012
On 01/18/2012 12:32 PM, Paul Berry wrote:
> Commit ede60bc4670a8d9c14921c77abee1ac57fc0e6bf (glsl: Add isinf() and
> isnan() builtins) uses "+INF" in the .ir file to represent infinity.
> This worked on C99-compliant compilers, since the s-expression reader
> uses strtod() to read numbers, and C99 requires strtod() to understand
> "+INF". However, it didn't work on non-C99-compliant compilers such
> as MSVC.
>
> This patch modifies the s-expression reader to explicitly check for
> "+INF" rather than relying on strtod() to support it.
>
> This is a candidate for the 8.0 branch.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44767
> Tested-by: Morgan Armand<morgan.devel at gmail.com>
Ah, C89, how I hate thee...
I'm in favor of only reading "+INF" for now. This looks acceptable.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
More information about the mesa-dev
mailing list