glsl: Fix isinf() for non-C99-compliant compilers.
authorPaul Berry <stereotype441@gmail.com>
Tue, 17 Jan 2012 18:28:10 +0000 (10:28 -0800)
committerPaul Berry <stereotype441@gmail.com>
Fri, 20 Jan 2012 02:45:22 +0000 (18:45 -0800)
commit4f82fed49359676fc19598f8c65ca51958dd2d79
tree5914359f9f0c8a396d978cbef2bf76252d3af9ea
parent5e576efef2397e6748e0dc727d92d1064bf90efe
glsl: Fix isinf() for non-C99-compliant compilers.

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@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/s_expression.cpp