#include "util/u_rect.h"
+/* Make all the #if cases in the code esier to read */
+/* XXX can it be set to 1? */
+#ifndef DRI2INFOREC_VERSION
+#define DRI2INFOREC_VERSION 0
+#endif
+
typedef struct {
PixmapPtr pPixmap;
struct pipe_texture *tex;
case DRI2BufferFrontLeft:
break;
case DRI2BufferStencil:
-#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION > 2
+#if DRI2INFOREC_VERSION >= 3
case DRI2BufferDepthStencil:
#else
/* Works on old X servers because sanity checking is for the weak */
buffer->cpp = 4;
buffer->driverPrivate = private;
buffer->flags = 0; /* not tiled */
-#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION == 2
+#if DRI2INFOREC_VERSION == 2
((DRI2Buffer2Ptr)buffer)->format = 0;
-#elif defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 3
+#elif DRI2INFOREC_VERSION >= 3
buffer->format = 0;
#endif
private->tex = tex;
(*pScreen->DestroyPixmap)(private->pPixmap);
}
-#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 2
+#if DRI2INFOREC_VERSION >= 2
static DRI2Buffer2Ptr
driCreateBuffer(DrawablePtr pDraw, unsigned int attachment, unsigned int format)
xfree(buffer);
}
-#else /* !defined(DRI2INFOREC_VERSION) || DRI2INFOREC_VERSION < 2 */
+#else /* DRI2INFOREC_VERSION < 2 */
static DRI2BufferPtr
driCreateBuffers(DrawablePtr pDraw, unsigned int *attachments, int count)
}
}
-#endif /* defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 2 */
+#endif /* DRI2INFOREC_VERSION >= 2 */
static void
driCopyRegion(DrawablePtr pDraw, RegionPtr pRegion,
modesettingPtr ms = modesettingPTR(pScrn);
DRI2InfoRec dri2info;
-#if defined(DRI2INFOREC_VERSION)
+#if DRI2INFORCE_VERSION >= 2
dri2info.version = DRI2INFOREC_VERSION;
#else
dri2info.version = 1;
dri2info.driverName = pScrn->driverName;
dri2info.deviceName = "/dev/dri/card0"; /* FIXME */
-#if defined(DRI2INFOREC_VERSION) && DRI2INFOREC_VERSION >= 2
+#if DRI2INFOREC_VERSION >= 2
dri2info.CreateBuffer = driCreateBuffer;
dri2info.DestroyBuffer = driDestroyBuffer;
#else