> Module: Mesa
> Branch: master
> Commit: 062a1e291fdc0ef69b6677f8ae0e3471047e281d
> URL:    
> http://cgit.freedesktop.org/mesa/mesa/commit/?id=062a1e291fdc0ef69b6677f8ae0e3471047e281d
> 
> Author: Stéphane Marchesin <marcheu at chromium.org>
> Date:   Tue Jun 28 00:53:01 2011 -0700
> 
> i915g: Improve SIN/COS a bit.
> 
> ---
> 
>  src/gallium/drivers/i915/i915_fpc_translate.c |   40 ++++++++++++------------
>  1 files changed, 20 insertions(+), 20 deletions(-)

This adds some more uses of M_PI to i915_fpc_translate.c, before the
definition of M_PI it makes for the benefit of <math.h> which don't define
M_PI. See [1].

Attached is a patch which fixes this by moving the definition of M_PI.

I'm not sure why this file and the few others which do this, don't include
compiler.h for the definition M_PI there...

[1] http://tinderbox.freedesktop.org/builds/2011-06-28-0002/logs/libGL/#build
>From 135e6608f9f5e1afb631049846769de739684e44 Mon Sep 17 00:00:00 2001
From: Jon TURNEY <jon.tur...@dronecode.org.uk>
Date: Wed, 29 Jun 2011 12:43:11 +0100
Subject: [PATCH] i915g: Move definition of M_PI in i915_fpc_translate.c

Move defintion of M_PI (for the benefit of <math.h> which do not define it), to
before the first use of it

Signed-off-by: Jon TURNEY <jon.tur...@dronecode.org.uk>
---
 src/gallium/drivers/i915/i915_fpc_translate.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c 
b/src/gallium/drivers/i915/i915_fpc_translate.c
index ab09d56..93fe453 100644
--- a/src/gallium/drivers/i915/i915_fpc_translate.c
+++ b/src/gallium/drivers/i915/i915_fpc_translate.c
@@ -41,6 +41,9 @@
 
 #include "draw/draw_vertex.h"
 
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
 
 /**
  * Simple pass-through fragment shader to use when we don't have
@@ -442,11 +445,6 @@ emit_simple_arith_swap2(struct i915_fp_compile *p,
    emit_simple_arith(p, &inst2, opcode, numArgs, fs);
 }
 
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
 /*
  * Translate TGSI instruction to i915 instruction.
  *
-- 
1.7.5.1

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to