-/* $Id: imports.c,v 1.23 2002/10/30 19:40:20 brianp Exp $ */
+/* $Id: imports.c,v 1.24 2002/10/30 19:44:41 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 5.0
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
void *
_mesa_malloc(size_t bytes)
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86malloc(bytes);
#else
return malloc(bytes);
void *
_mesa_calloc(size_t bytes)
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86calloc(1, bytes);
#else
return calloc(1, bytes);
void
_mesa_free(void *ptr)
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
xf86free(ptr);
#else
free(ptr);
void *
_mesa_memcpy(void *dest, const void *src, size_t n)
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86memcpy(dest, src, n);
#elif defined(SUNOS4)
return memcpy((char *) dest, (char *) src, (int) n);
void
_mesa_memset( void *dst, int val, size_t n )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
xf86memset( dst, val, n );
#elif defined(SUNOS4)
memset( (char *) dst, (int) val, (int) n );
void
_mesa_bzero( void *dst, size_t n )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
xf86memset( dst, 0, n );
#elif defined(__FreeBSD__)
bzero( dst, n );
double
_mesa_sin(double a)
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86sin(a);
#else
return sin(a);
double
_mesa_cos(double a)
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86cos(a);
#else
return cos(a);
double
_mesa_sqrt(double x)
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86sqrt(x);
#else
return sqrt(x);
double
_mesa_pow(double x, double y)
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86pow(x, y);
#else
return pow(x, y);
char *
_mesa_getenv( const char *var )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86getenv(var);
#else
return getenv(var);
char *
_mesa_strstr( const char *haystack, const char *needle )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86strstr(haystack, needle);
#else
return strstr(haystack, needle);
char *
_mesa_strncat( char *dest, const char *src, size_t n )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86strncat(dest, src, n);
#else
return strncat(dest, src, n);
char *
_mesa_strcpy( char *dest, const char *src )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86strcpy(dest, src);
#else
return strcpy(dest, src);
char *
_mesa_strncpy( char *dest, const char *src, size_t n )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86strncpy(dest, src, n);
#else
return strncpy(dest, src, n);
size_t
_mesa_strlen( const char *s )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86strlen(s);
#else
return strlen(s);
int
_mesa_strcmp( const char *s1, const char *s2 )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86strcmp(s1, s2);
#else
return strcmp(s1, s2);
int
_mesa_strncmp( const char *s1, const char *s2, size_t n )
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86strncmp(s1, s2, n);
#else
return strncmp(s1, s2, n);
int
_mesa_atoi(const char *s)
{
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86atoi(s);
#else
return atoi(s);
va_list args;
va_start( args, fmt );
va_end( args );
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
r = xf86vsprintf( str, fmt, args );
#else
r = vsprintf( str, fmt, args );
va_start( args, fmtString );
vsnprintf(s, MAXSTRING, fmtString, args);
va_end( args );
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
xf86printf("%s", s);
#else
printf("%s", s);
debug = _mesa_getenv("MESA_DEBUG") ? GL_TRUE : GL_FALSE;
#endif
if (debug) {
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
xf86fprintf(stderr, "Mesa warning: %s\n", str);
#else
fprintf(stderr, "Mesa warning: %s\n", str);
_mesa_problem( const GLcontext *ctx, const char *s )
{
(void) ctx;
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
xf86fprintf(stderr, "Mesa implementation error: %s\n", s);
xf86fprintf(stderr, "Please report to the DRI project at dri.sourceforge.net\n");
#else
va_start(args, fmtString);
vsnprintf(s, MAXSTRING, fmtString, args);
va_end(args);
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
xf86fprintf(stderr, "Mesa: %s", s);
#else
fprintf(stderr, "Mesa: %s", s);
default_realloc(__GLcontext *gc, void *oldAddr, size_t newSize)
{
(void) gc;
-#ifdef XFree86LOADER
+#if defined(XFree86LOADER) && defined(IN_MODULE)
return xf86realloc(oldAddr, newSize);
#else
return realloc(oldAddr, newSize);