summaryrefslogtreecommitdiff
path: root/graphics/MesaLib
diff options
context:
space:
mode:
authorkristerw <kristerw@pkgsrc.org>2006-01-31 21:44:31 +0000
committerkristerw <kristerw@pkgsrc.org>2006-01-31 21:44:31 +0000
commitc56fea569da4c2a57fe355eb258b98e4c5f6b21d (patch)
tree0a7acf9cbc1db09311bb972eb4e52cfd9fb97f4e /graphics/MesaLib
parent288bf3e88ac1b7e5d01d3162f62d68a8883b28ad (diff)
downloadpkgsrc-c56fea569da4c2a57fe355eb258b98e4c5f6b21d.tar.gz
Fix some more places where the evil macro RENDER_SPAN prevents this
package from building with gcc 2.95.
Diffstat (limited to 'graphics/MesaLib')
-rw-r--r--graphics/MesaLib/distinfo4
-rw-r--r--graphics/MesaLib/patches/patch-al839
-rw-r--r--graphics/MesaLib/patches/patch-am43
3 files changed, 885 insertions, 1 deletions
diff --git a/graphics/MesaLib/distinfo b/graphics/MesaLib/distinfo
index c10929dd7ae..bc4983dc87d 100644
--- a/graphics/MesaLib/distinfo
+++ b/graphics/MesaLib/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.35 2006/01/30 08:54:55 rillig Exp $
+$NetBSD: distinfo,v 1.36 2006/01/31 21:44:31 kristerw Exp $
SHA1 (Mesa-6.4.1/MesaLib-6.4.1.tar.bz2) = efb70276ccd9cd13dbd7d5e581213a5ca3e4ef25
RMD160 (Mesa-6.4.1/MesaLib-6.4.1.tar.bz2) = e3a54d6442fa5d6e446bb0b6704bd22c31fb4927
@@ -20,3 +20,5 @@ SHA1 (patch-ah) = b9ee33c497b8abe2af004a4f13219a19f413f30e
SHA1 (patch-ai) = 3c5e4cc1e054514111d50c1d01257f4647b14558
SHA1 (patch-aj) = a805947e1aaf73a798fd3a8c6e39bf1bd62afc3a
SHA1 (patch-ak) = 3cce21b97f828895e73aa75469ce75de4f84be83
+SHA1 (patch-al) = 8ccbc370bc52882ee72ba76b72a99f163f7b89a7
+SHA1 (patch-am) = 7a96e7b4afaba76c8b86e2ee9c5c0c6a4f51a717
diff --git a/graphics/MesaLib/patches/patch-al b/graphics/MesaLib/patches/patch-al
new file mode 100644
index 00000000000..15f9935563f
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-al
@@ -0,0 +1,839 @@
+$NetBSD: patch-al,v 1.1 2006/01/31 21:44:31 kristerw Exp $
+
+Declarations inside of macros are evil. Even more if they are not preceded
+by an additional opening brace.
+
+--- src/mesa/drivers/x11/xm_tri.c.orig Tue Jan 31 22:16:56 2006
++++ src/mesa/drivers/x11/xm_tri.c Tue Jan 31 22:30:15 2006
+@@ -64,7 +64,7 @@
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb);
+
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ GLuint i; \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -80,7 +80,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+
+ #include "swrast/s_tritemp.h"
+
+@@ -99,7 +99,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -112,7 +112,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+
+ #include "swrast/s_tritemp.h"
+
+@@ -131,7 +131,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -144,7 +144,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+
+ #include "swrast/s_tritemp.h"
+
+@@ -163,7 +163,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -176,7 +176,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+
+ #include "swrast/s_tritemp.h"
+
+@@ -194,7 +194,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -209,7 +209,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -224,7 +224,7 @@
+ #define SETUP_CODE \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -240,7 +240,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -257,7 +257,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -270,7 +270,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -288,7 +288,7 @@
+ #define SETUP_CODE \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -302,7 +302,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -319,7 +319,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ XDITHER_SETUP(y); \
+@@ -334,7 +334,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -349,7 +349,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ XMesaImage *img = xrb->ximage;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ XDITHER_SETUP(y); \
+@@ -365,7 +365,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -382,7 +382,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ LOOKUP_SETUP; \
+ for (i = 0; i < span.end; i++) { \
+@@ -396,7 +396,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -414,7 +414,7 @@
+ #define SETUP_CODE \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -428,7 +428,7 @@
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -445,7 +445,7 @@
+ XMesaImage *img = xrb->ximage; \
+ unsigned long pixel; \
+ PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -455,7 +455,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -472,7 +472,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ GLuint p = PACK_8B8G8R( v2->color[0], v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -481,7 +481,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -498,7 +498,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ GLuint p = PACK_8R8G8B( v2->color[0], v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -507,7 +507,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -524,7 +524,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ GLuint p = PACK_8R8G8B( v2->color[0], v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -533,7 +533,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+
+ #include "swrast/s_tritemp.h"
+
+@@ -551,7 +551,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ const GLubyte *color = v2->color;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -563,7 +563,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -578,7 +578,7 @@
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb); \
+ XMesaImage *img = xrb->ximage;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -591,7 +591,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -608,7 +608,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ GLushort p = PACK_5R6G5B( v2->color[0], v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -617,7 +617,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -635,7 +635,7 @@
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb); \
+ const GLubyte *color = v2->color;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -646,7 +646,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -663,7 +663,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ FLAT_DITHER_ROW_SETUP(YFLIP(xrb, y)); \
+@@ -674,7 +674,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -689,7 +689,7 @@
+ GET_XRB(xrb); \
+ XMesaImage *img = xrb->ximage; \
+ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ FLAT_DITHER_ROW_SETUP(y); \
+@@ -701,7 +701,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -721,7 +721,7 @@
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2];
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -731,7 +731,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -752,7 +752,7 @@
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2]; \
+ GLubyte p = LOOKUP(r,g,b);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ const DEPTH_TYPE z = FixedToDepth(span.z); \
+@@ -761,7 +761,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -775,7 +775,7 @@
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb); \
+ XMesaImage *img = xrb->ximage;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -786,7 +786,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -801,7 +801,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = PACK_8B8G8R(FixedToInt(span.red), \
+@@ -809,7 +809,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -824,7 +824,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = PACK_8R8G8B(FixedToInt(span.red), \
+@@ -832,7 +832,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -847,7 +847,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = PACK_8R8G8B(FixedToInt(span.red), \
+@@ -855,7 +855,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -870,7 +870,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ PIXEL_TYPE *pixel = pRow; \
+ for (i = 0; i < span.end; i++, pixel++) { \
+@@ -880,7 +880,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -894,7 +894,7 @@
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb); \
+ XMesaImage *img = xrb->ximage;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -905,7 +905,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -920,7 +920,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) PACK_5R6G5B(FixedToInt(span.red), \
+@@ -928,7 +928,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -944,7 +944,7 @@
+ #define SETUP_CODE \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -953,7 +953,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -968,7 +968,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ XDITHER_SETUP(y); \
+@@ -978,7 +978,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -991,7 +991,7 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ XMesaImage *img = xrb->ximage;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ XDITHER_SETUP(y); \
+@@ -1002,7 +1002,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1017,7 +1017,7 @@
+ #define BYTES_PER_ROW (xrb->ximage->bytes_per_line)
+ #define SETUP_CODE \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ LOOKUP_SETUP; \
+ for (i = 0; i < span.end; i++) { \
+@@ -1026,7 +1026,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1042,7 +1042,7 @@
+ #define SETUP_CODE \
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -1051,7 +1051,7 @@
+ span.red += span.redStep; \
+ span.green += span.greenStep; \
+ span.blue += span.blueStep; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1066,12 +1066,12 @@
+ XMesaImage *img = xrb->ximage; \
+ unsigned long pixel; \
+ PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+ XMesaPutPixel(img, x, y, pixel); \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1087,11 +1087,11 @@
+ GET_XRB(xrb); \
+ unsigned long p = PACK_8B8G8R( v2->color[0], \
+ v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) p; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1107,11 +1107,11 @@
+ GET_XRB(xrb); \
+ unsigned long p = PACK_8R8G8B( v2->color[0], \
+ v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) p; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1127,11 +1127,11 @@
+ GET_XRB(xrb); \
+ unsigned long p = PACK_8R8G8B( v2->color[0], \
+ v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) p; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1146,14 +1146,14 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ const GLubyte *color = v2->color;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ PIXEL_TYPE *pixel = pRow; \
+ for (i = 0; i < span.end; i++, pixel++) { \
+ pixel->r = color[RCOMP]; \
+ pixel->g = color[GCOMP]; \
+ pixel->b = color[BCOMP]; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1166,7 +1166,7 @@
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb); \
+ XMesaImage *img = xrb->ximage;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+@@ -1174,7 +1174,7 @@
+ PACK_TRUEDITHER(p, x, y, v2->color[0], \
+ v2->color[1], v2->color[2] ); \
+ XMesaPutPixel(img, x, y, p); \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1190,11 +1190,11 @@
+ GET_XRB(xrb); \
+ unsigned long p = PACK_5R6G5B( v2->color[0], \
+ v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) p; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1210,13 +1210,13 @@
+ XMesaContext xmesa = XMESA_CONTEXT(ctx); \
+ GET_XRB(xrb); \
+ const GLubyte *color = v2->color;
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+ PACK_TRUEDITHER(pRow[i], x, y, color[RCOMP], \
+ color[GCOMP], color[BCOMP]); \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1231,13 +1231,13 @@
+ #define SETUP_CODE \
+ GET_XRB(xrb); \
+ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ FLAT_DITHER_ROW_SETUP(YFLIP(xrb, y)); \
+ for (i = 0; i < span.end; i++, x++) { \
+ pRow[i] = (PIXEL_TYPE) FLAT_DITHER(x); \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1250,14 +1250,14 @@
+ GET_XRB(xrb); \
+ XMesaImage *img = xrb->ximage; \
+ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ FLAT_DITHER_ROW_SETUP(y); \
+ for (i = 0; i < span.end; i++, x++) { \
+ unsigned long p = FLAT_DITHER(x); \
+ XMesaPutPixel(img, x, y, p ); \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1275,12 +1275,12 @@
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2];
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLint x = span.x, y = YFLIP(xrb, span.y); \
+ for (i = 0; i < span.end; i++, x++) { \
+ pRow[i] = (PIXEL_TYPE) DITHER_HPCR(x, y, r, g, b); \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
+@@ -1299,11 +1299,11 @@
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2]; \
+ GLubyte p = LOOKUP(r,g,b);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ for (i = 0; i < span.end; i++) { \
+ pRow[i] = (PIXEL_TYPE) p; \
+- }
++ } }
+ #include "swrast/s_tritemp.h"
+
+
diff --git a/graphics/MesaLib/patches/patch-am b/graphics/MesaLib/patches/patch-am
new file mode 100644
index 00000000000..774bc73a96c
--- /dev/null
+++ b/graphics/MesaLib/patches/patch-am
@@ -0,0 +1,43 @@
+$NetBSD: patch-am,v 1.1 2006/01/31 21:44:31 kristerw Exp $
+
+Declarations inside of macros are evil. Even more if they are not preceded
+by an additional opening brace.
+
+--- src/mesa/drivers/osmesa/osmesa.c.orig Tue Jan 31 22:33:21 2006
++++ src/mesa/drivers/osmesa/osmesa.c Tue Jan 31 22:34:10 2006
+@@ -471,7 +471,7 @@
+ #define INTERP_ALPHA 1
+ #define SETUP_CODE \
+ const OSMesaContext osmesa = OSMESA_CONTEXT(ctx);
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLchan *img = PIXELADDR4(span.x, span.y); \
+ for (i = 0; i < span.end; i++, img += 4) { \
+@@ -487,7 +487,7 @@
+ span.blue += span.blueStep; \
+ span.alpha += span.alphaStep; \
+ span.z += span.zStep; \
+- }
++ } }
+ #ifdef WIN32
+ #include "..\swrast\s_tritemp.h"
+ #else
+@@ -508,7 +508,7 @@
+ PACK_RGBA((GLchan *) &pixel, v2->color[0], v2->color[1], \
+ v2->color[2], v2->color[3]);
+
+-#define RENDER_SPAN( span ) \
++#define RENDER_SPAN( span ) { \
+ GLuint i; \
+ GLuint *img = (GLuint *) PIXELADDR4(span.x, span.y); \
+ for (i = 0; i < span.end; i++) { \
+@@ -518,7 +518,7 @@
+ zRow[i] = z; \
+ } \
+ span.z += span.zStep; \
+- }
++ } }
+ #ifdef WIN32
+ #include "..\swrast\s_tritemp.h"
+ #else