Add the ability to define NO_LIBCWRAPPER to avoid libcwrapper brain damage.
authorEric Anholt <anholt@FreeBSD.org>
Sat, 11 Feb 2006 02:59:38 +0000 (02:59 +0000)
committerEric Anholt <anholt@FreeBSD.org>
Sat, 11 Feb 2006 02:59:38 +0000 (02:59 +0000)
If it's true that libcwrapper usage isn't necessary ever in the DllLoader world,
then this code should probbaly all go away.

src/mesa/main/glheader.h
src/mesa/main/imports.c
src/mesa/main/imports.h

index 316a008..aab7165 100644 (file)
@@ -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>
index bf1556f..474b358 100644 (file)
@@ -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 */
index 7ee1274..f8c0d7c 100644 (file)
@@ -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))