summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/glheader.h2
-rw-r--r--src/mesa/main/imports.c8
-rw-r--r--src/mesa/main/imports.h6
3 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 316a008ae3..aab7165c72 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -47,7 +47,7 @@
#define GLHEADER_H
-#if defined(XFree86LOADER) && defined(IN_MODULE)
+#if defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
#include "xf86_ansic.h"
#else
#include <assert.h>
diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index bf1556fe6f..474b358eb4 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -71,6 +71,14 @@ extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg);
#endif
#endif
+/* If we don't actually want to use the libcwrapper junk (even though we're
+ * building an Xorg server module), then just undef IN_MODULE to signal that to
+ * the following code. It's left around for now to allow compiling of newish
+ * Mesa with older servers, but this whole mess should go away at some point.
+ */
+#ifdef NO_LIBCWRAPPER
+#undef IN_MODULE
+#endif
/**********************************************************************/
/** \name Memory */
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 7ee127400a..f8c0d7cd63 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -161,7 +161,7 @@ typedef union { GLfloat f; GLint i; } fi_type;
***/
#if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */
# define SQRTF(X) _mesa_sqrtf(X)
-#elif defined(XFree86LOADER) && defined(IN_MODULE)
+#elif defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
# define SQRTF(X) (float) xf86sqrt((float) (X))
#else
# define SQRTF(X) (float) sqrt((float) (X))
@@ -209,7 +209,7 @@ static INLINE GLfloat LOG2(GLfloat val)
num.f = ((-1.0f/3) * num.f + 2) * num.f - 2.0f/3;
return num.f + log_2;
}
-#elif defined(XFree86LOADER) && defined(IN_MODULE)
+#elif defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
#define LOG2(x) ((GLfloat) (xf86log(x) * 1.442695))
#else
/*
@@ -281,7 +281,7 @@ static INLINE int GET_FLOAT_BITS( float x )
*** LDEXPF: multiply value by an integral power of two
*** FREXPF: extract mantissa and exponent from value
***/
-#if defined(XFree86LOADER) && defined(IN_MODULE)
+#if defined(XFree86LOADER) && defined(IN_MODULE) && !defined(NO_LIBCWRAPPER)
#define CEILF(x) ((GLfloat) xf86ceil(x))
#define FLOORF(x) ((GLfloat) xf86floor(x))
#define FABSF(x) ((GLfloat) xf86fabs(x))