[Mesa-dev] [PATCH] glsl: Define isnormal and copysign for MSVC to fix build.
Matt Turner
mattst88 at gmail.com
Fri Sep 20 18:28:53 PDT 2013
On Fri, Sep 20, 2013 at 6:03 PM, Vinson Lee <vlee at freedesktop.org> wrote:
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69541
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
> src/glsl/ir_constant_expression.cpp | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/src/glsl/ir_constant_expression.cpp b/src/glsl/ir_constant_expression.cpp
> index 4579ef2..805e1f3 100644
> --- a/src/glsl/ir_constant_expression.cpp
> +++ b/src/glsl/ir_constant_expression.cpp
> @@ -40,6 +40,18 @@
> #include "glsl_types.h"
> #include "program/hash_table.h"
>
> +#if defined(_MSC_VER) && (_MSC_VER < 1800)
> +static int isnormal(double x) {
> + return _fpclass(x) == _FPCLASS_NN || _fpclass(x) == _FPCLASS_PN;
> +}
> +#endif
> +
> +#if defined(_MSC_VER)
> +static double copysign(double x, double y) {
> + return _copysign(x, y);
> +}
> +#endif
> +
> static float
> dot(ir_constant *op0, ir_constant *op1)
> {
> --
> 1.8.1.2
Thanks Vinson,
Acked-by: Matt Turner <mattst88 at gmail.com>
More information about the mesa-dev
mailing list