2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Standard C library function wrappers.
30 * This file provides wrappers for all the standard C library functions
31 * like malloc(), free(), printf(), getenv(), etc.
39 /* XXX some of the stuff in glheader.h should be moved into this file.
49 /**********************************************************************/
50 /** \name General macros */
60 /**********************************************************************/
64 /** Allocate \p BYTES bytes */
65 #define MALLOC(BYTES) _mesa_malloc(BYTES)
66 /** Allocate and zero \p BYTES bytes */
67 #define CALLOC(BYTES) _mesa_calloc(BYTES)
68 /** Allocate a structure of type \p T */
69 #define MALLOC_STRUCT(T) (struct T *) _mesa_malloc(sizeof(struct T))
70 /** Allocate and zero a structure of type \p T */
71 #define CALLOC_STRUCT(T) (struct T *) _mesa_calloc(sizeof(struct T))
73 #define FREE(PTR) _mesa_free(PTR)
75 /** Allocate \p BYTES aligned at \p N bytes */
76 #define ALIGN_MALLOC(BYTES, N) _mesa_align_malloc(BYTES, N)
77 /** Allocate and zero \p BYTES bytes aligned at \p N bytes */
78 #define ALIGN_CALLOC(BYTES, N) _mesa_align_calloc(BYTES, N)
79 /** Allocate a structure of type \p T aligned at \p N bytes */
80 #define ALIGN_MALLOC_STRUCT(T, N) (struct T *) _mesa_align_malloc(sizeof(struct T), N)
81 /** Allocate and zero a structure of type \p T aligned at \p N bytes */
82 #define ALIGN_CALLOC_STRUCT(T, N) (struct T *) _mesa_align_calloc(sizeof(struct T), N)
83 /** Free aligned memory */
84 #define ALIGN_FREE(PTR) _mesa_align_free(PTR)
86 /** Copy \p BYTES bytes from \p SRC into \p DST */
87 #define MEMCPY( DST, SRC, BYTES) _mesa_memcpy(DST, SRC, BYTES)
88 /** Set \p N bytes in \p DST to \p VAL */
89 #define MEMSET( DST, VAL, N ) _mesa_memset(DST, VAL, N)
91 #define MEMSET16( DST, VAL, N ) _mesa_memset16( (DST), (VAL), (size_t) (N) )
97 * For GL_ARB_vertex_buffer_object we need to treat vertex array pointers
98 * as offsets into buffer stores. Since the vertex array pointer and
99 * buffer store pointer are both pointers and we need to add them, we use
101 * Both pointers/offsets are expressed in bytes.
103 #define ADD_POINTERS(A, B) ( (A) + (unsigned long) (B) )
106 /**********************************************************************/
107 /** \name [Pseudo] static array declaration.
109 * MACs and BeOS don't support static larger than 32kb, so ...
115 * Define a [static] unidimensional array
120 * Define a [static] bi-dimensional array
125 * Define a [static] tri-dimensional array
130 * Verifies a [static] array was properly allocated.
135 * Undefine (free) a [static] array.
138 #if defined(macintosh) && !defined(__MRC__)
139 /*extern char *AGLAlloc(int size);*/
140 /*extern void AGLFree(char* ptr);*/
141 # define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_alloc(sizeof(TYPE)*(SIZE))
142 # define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
143 # define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_alloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
144 # define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
145 # define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0)
146 #elif defined(__BEOS__)
147 # define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)_mesa_malloc(sizeof(TYPE)*(SIZE))
148 # define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2))
149 # define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE (*NAME)[SIZE2][SIZE3] = (TYPE(*)[SIZE2][SIZE3])_mesa_malloc(sizeof(TYPE)*(SIZE1)*(SIZE2)*(SIZE3))
150 # define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0)
151 # define UNDEFARRAY(NAME) do {if ((NAME)) {_mesa_free((char*)NAME);} }while (0)
153 # define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE]
154 # define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2]
155 # define DEFMNARRAY(TYPE,NAME,SIZE1,SIZE2,SIZE3) TYPE NAME[SIZE1][SIZE2][SIZE3]
156 # define CHECKARRAY(NAME,CMD) do {} while(0)
157 # define UNDEFARRAY(NAME)
163 /**********************************************************************/
164 /** \name External pixel buffer allocation.
166 * If you want Mesa's depth/stencil/accum/etc buffers to be allocated with a
167 * specialized allocator you can define MESA_EXTERNAL_BUFFERALLOC and implement
168 * _ext_mesa_alloc_pixelbuffer() _ext_mesa_free_pixelbuffer() in your
172 * Contributed by Gerk Huisma (gerk@five-d.demon.nl).
177 * \def MESA_PBUFFER_ALLOC
178 * Allocate a pixel buffer.
182 * \def MESA_PBUFFER_FREE
183 * Free a pixel buffer.
186 #ifdef MESA_EXTERNAL_BUFFERALLOC
187 extern void *_ext_mesa_alloc_pixelbuffer( unsigned int size
);
188 extern void _ext_mesa_free_pixelbuffer( void *pb
);
190 #define MESA_PBUFFER_ALLOC(BYTES) (void *) _ext_mesa_alloc_pixelbuffer(BYTES)
191 #define MESA_PBUFFER_FREE(PTR) _ext_mesa_free_pixelbuffer(PTR)
193 /* Default buffer allocation uses the aligned allocation routines: */
194 #define MESA_PBUFFER_ALLOC(BYTES) (void *) _mesa_align_malloc(BYTES, 512)
195 #define MESA_PBUFFER_FREE(PTR) _mesa_align_free(PTR)
202 /**********************************************************************
206 #define MAX_GLUSHORT 0xffff
207 #define MAX_GLUINT 0xffffffff
210 #define M_PI (3.1415926536)
213 /* XXX this is a bit of a hack needed for compilation within XFree86 */
215 #define FLT_MIN (1.0e-37)
218 /* Degrees to radians conversion: */
219 #define DEG2RAD (M_PI/180.0)
223 *** USE_IEEE: Determine if we're using IEEE floating point
225 #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \
226 defined(__s390x__) || defined(__powerpc__) || \
227 defined(__AMD64__) || \
228 defined(ia64) || defined(__ia64__) || \
229 defined(__hppa__) || defined(hpux) || \
230 defined(__mips) || defined(_MIPS_ARCH) || \
231 (defined(__alpha__) && (defined(__IEEE_FLOAT) || !defined(VMS)))
233 #define IEEE_ONE 0x3f800000
238 *** SQRTF: single-precision square root
240 #if 0 /* _mesa_sqrtf() not accurate enough - temporarily disabled */
241 # define SQRTF(X) _mesa_sqrtf(X)
242 #elif defined(XFree86LOADER) && defined(IN_MODULE)
243 # define SQRTF(X) (float) xf86sqrt((float) (X))
245 # define SQRTF(X) (float) sqrt((float) (X))
250 *** INV_SQRTF: single-precision inverse square root
253 #define INV_SQRTF(X) _mesa_inv_sqrt(X)
255 #define INV_SQRTF(X) (1.0F / SQRTF(X)) /* this is faster on a P4 */
260 *** LOG2: Log base 2 of float
264 /* This is pretty fast, but not accurate enough (only 2 fractional bits).
265 * Based on code from http://www.stereopsis.com/log2.html
267 static INLINE GLfloat
LOG2(GLfloat x
)
269 const GLfloat y
= x
* x
* x
* x
;
270 const GLuint ix
= *((GLuint
*) &y
);
271 const GLuint exp
= (ix
>> 23) & 0xFF;
272 const GLint log2
= ((GLint
) exp
) - 127;
273 return (GLfloat
) log2
* (1.0 / 4.0); /* 4, because of x^4 above */
276 /* Pretty fast, and accurate.
277 * Based on code from http://www.flipcode.com/totd/
279 static INLINE GLfloat
LOG2(GLfloat val
)
284 log_2
= ((num
.i
>> 23) & 255) - 128;
285 num
.i
&= ~(255 << 23);
287 num
.f
= ((-1.0f
/3) * num
.f
+ 2) * num
.f
- 2.0f
/3;
288 return num
.f
+ log_2
;
290 #elif defined(XFree86LOADER) && defined(IN_MODULE)
291 #define LOG2(x) ((GLfloat) (xf86log(x) * 1.442695))
294 * NOTE: log_base_2(x) = log(x) / log(2)
295 * NOTE: 1.442695 = 1/log(2).
297 #define LOG2(x) ((GLfloat) (log(x) * 1.442695F))
302 *** IS_INF_OR_NAN: test if float is infinite or NaN
305 static INLINE
int IS_INF_OR_NAN( float x
)
309 return !(int)((unsigned int)((tmp
.i
& 0x7fffffff)-0x7f800000) >> 31);
311 #elif defined(isfinite)
312 #define IS_INF_OR_NAN(x) (!isfinite(x))
313 #elif defined(finite)
314 #define IS_INF_OR_NAN(x) (!finite(x))
316 #define IS_INF_OR_NAN(x) (!finite(x))
317 #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
318 #define IS_INF_OR_NAN(x) (!isfinite(x))
320 #define IS_INF_OR_NAN(x) (!finite(x))
325 *** IS_NEGATIVE: test if float is negative
327 #if defined(USE_IEEE)
328 #define GET_FLOAT_BITS(x) ((fi_type *) &(x))->i
329 #define IS_NEGATIVE(x) (GET_FLOAT_BITS(x) & (1<<31))
331 #define IS_NEGATIVE(x) (x < 0.0F)
336 *** DIFFERENT_SIGNS: test if two floats have opposite signs
338 #if defined(USE_IEEE)
339 #define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
341 /* Could just use (x*y<0) except for the flatshading requirements.
342 * Maybe there's a better way?
344 #define DIFFERENT_SIGNS(x,y) ((x) * (y) <= 0.0F && (x) - (y) != 0.0F)
349 *** CEILF: ceiling of float
350 *** FLOORF: floor of float
351 *** FABSF: absolute value of float
353 #if defined(XFree86LOADER) && defined(IN_MODULE)
354 #define CEILF(x) ((GLfloat) xf86ceil(x))
355 #define FLOORF(x) ((GLfloat) xf86floor(x))
356 #define FABSF(x) ((GLfloat) xf86fabs(x))
357 #elif defined(__gnu_linux__)
359 #define CEILF(x) ceilf(x)
360 #define FLOORF(x) floorf(x)
361 #define FABSF(x) fabsf(x)
363 #define CEILF(x) ((GLfloat) ceil(x))
364 #define FLOORF(x) ((GLfloat) floor(x))
365 #define FABSF(x) ((GLfloat) fabs(x))
370 *** IROUND: return (as an integer) float rounded to nearest integer
372 #if defined(USE_SPARC_ASM) && defined(__GNUC__) && defined(__sparc__)
373 static INLINE
int iround(float f
)
376 __asm__ ("fstoi %1, %0" : "=f" (r
) : "f" (f
));
379 #define IROUND(x) iround(x)
380 #elif defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__) && \
381 (!defined(__BEOS__) || (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)))
382 static INLINE
int iround(float f
)
385 __asm__ ("fistpl %0" : "=m" (r
) : "t" (f
) : "st");
388 #define IROUND(x) iround(x)
389 #elif defined(USE_X86_ASM) && defined(__MSC__) && defined(__WIN32__)
390 static INLINE
int iround(float f
)
399 #define IROUND(x) iround(x)
400 #elif defined(__WATCOMC__) && defined(__386__)
401 long iround(float f
);
402 #pragma aux iround = \
404 "fistp dword ptr [esp]" \
409 #define IROUND(x) iround(x)
411 #define IROUND(f) ((int) (((f) >= 0.0F) ? ((f) + 0.5F) : ((f) - 0.5F)))
416 *** IROUND_POS: return (as an integer) positive float rounded to nearest int
419 #define IROUND_POS(f) (assert((f) >= 0.0F), IROUND(f))
421 #define IROUND_POS(f) (IROUND(f))
426 *** IFLOOR: return (as an integer) floor of float
428 #if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
430 * IEEE floor for computers that round to nearest or even.
431 * 'f' must be between -4194304 and 4194303.
432 * This floor operation is done by "(iround(f + .5) + iround(f - .5)) >> 1",
433 * but uses some IEEE specific tricks for better speed.
434 * Contributed by Josh Vanderhoof
436 static INLINE
int ifloor(float f
)
440 af
= (3 << 22) + 0.5 + (double)f
;
441 bf
= (3 << 22) + 0.5 - (double)f
;
442 /* GCC generates an extra fstp/fld without this. */
443 __asm__ ("fstps %0" : "=m" (ai
) : "t" (af
) : "st");
444 __asm__ ("fstps %0" : "=m" (bi
) : "t" (bf
) : "st");
445 return (ai
- bi
) >> 1;
447 #define IFLOOR(x) ifloor(x)
448 #elif defined(USE_IEEE)
449 static INLINE
int ifloor(float f
)
455 af
= (3 << 22) + 0.5 + (double)f
;
456 bf
= (3 << 22) + 0.5 - (double)f
;
457 u
.f
= (float) af
; ai
= u
.i
;
458 u
.f
= (float) bf
; bi
= u
.i
;
459 return (ai
- bi
) >> 1;
461 #define IFLOOR(x) ifloor(x)
463 static INLINE
int ifloor(float f
)
466 return (i
> f
) ? i
- 1 : i
;
468 #define IFLOOR(x) ifloor(x)
473 *** ICEIL: return (as an integer) ceiling of float
475 #if defined(USE_X86_ASM) && defined(__GNUC__) && defined(__i386__)
477 * IEEE ceil for computers that round to nearest or even.
478 * 'f' must be between -4194304 and 4194303.
479 * This ceil operation is done by "(iround(f + .5) + iround(f - .5) + 1) >> 1",
480 * but uses some IEEE specific tricks for better speed.
481 * Contributed by Josh Vanderhoof
483 static INLINE
int iceil(float f
)
487 af
= (3 << 22) + 0.5 + (double)f
;
488 bf
= (3 << 22) + 0.5 - (double)f
;
489 /* GCC generates an extra fstp/fld without this. */
490 __asm__ ("fstps %0" : "=m" (ai
) : "t" (af
) : "st");
491 __asm__ ("fstps %0" : "=m" (bi
) : "t" (bf
) : "st");
492 return (ai
- bi
+ 1) >> 1;
494 #define ICEIL(x) iceil(x)
495 #elif defined(USE_IEEE)
496 static INLINE
int iceil(float f
)
501 af
= (3 << 22) + 0.5 + (double)f
;
502 bf
= (3 << 22) + 0.5 - (double)f
;
503 u
.f
= (float) af
; ai
= u
.i
;
504 u
.f
= (float) bf
; bi
= u
.i
;
505 return (ai
- bi
+ 1) >> 1;
507 #define ICEIL(x) iceil(x)
509 static INLINE
int iceil(float f
)
512 return (i
< f
) ? i
+ 1 : i
;
514 #define ICEIL(x) iceil(x)
519 *** UNCLAMPED_FLOAT_TO_UBYTE: clamp float to [0,1] and map to ubyte in [0,255]
520 *** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255]
522 #if defined(USE_IEEE) && !defined(DEBUG)
523 #define IEEE_0996 0x3f7f0000 /* 0.996 or so */
524 /* This function/macro is sensitive to precision. Test very carefully
527 #define UNCLAMPED_FLOAT_TO_UBYTE(UB, F) \
533 else if (__tmp.i >= IEEE_0996) \
534 UB = (GLubyte) 255; \
536 __tmp.f = __tmp.f * (255.0F/256.0F) + 32768.0F; \
537 UB = (GLubyte) __tmp.i; \
540 #define CLAMPED_FLOAT_TO_UBYTE(UB, F) \
543 __tmp.f = (F) * (255.0F/256.0F) + 32768.0F; \
544 UB = (GLubyte) __tmp.i; \
547 #define UNCLAMPED_FLOAT_TO_UBYTE(ub, f) \
548 ub = ((GLubyte) IROUND(CLAMP((f), 0.0F, 1.0F) * 255.0F))
549 #define CLAMPED_FLOAT_TO_UBYTE(ub, f) \
550 ub = ((GLubyte) IROUND((f) * 255.0F))
555 *** COPY_FLOAT: copy a float from src to dest, avoid slow FP regs if possible
557 #if defined(USE_IEEE) && !defined(DEBUG)
558 #define COPY_FLOAT( dst, src ) \
559 ((fi_type *) &(dst))->i = ((fi_type *) (void *) &(src))->i
561 #define COPY_FLOAT( dst, src ) (dst) = (src)
566 *** START_FAST_MATH: Set x86 FPU to faster, 32-bit precision mode (and save
567 *** original mode to a temporary).
568 *** END_FAST_MATH: Restore x86 FPU to original mode.
570 #if defined(__GNUC__) && defined(__i386__)
572 * Set the x86 FPU control word to guarentee only 32 bits of precision
573 * are stored in registers. Allowing the FPU to store more introduces
574 * differences between situations where numbers are pulled out of memory
575 * vs. situations where the compiler is able to optimize register usage.
577 * In the worst case, we force the compiler to use a memory access to
578 * truncate the float, by specifying the 'volatile' keyword.
580 /* Hardware default: All exceptions masked, extended double precision,
581 * round to nearest (IEEE compliant):
583 #define DEFAULT_X86_FPU 0x037f
584 /* All exceptions masked, single precision, round to nearest:
586 #define FAST_X86_FPU 0x003f
587 /* The fldcw instruction will cause any pending FP exceptions to be
588 * raised prior to entering the block, and we clear any pending
589 * exceptions before exiting the block. Hence, asm code has free
590 * reign over the FPU while in the fast math block.
592 #if defined(NO_FAST_MATH)
593 #define START_FAST_MATH(x) \
595 static GLuint mask = DEFAULT_X86_FPU; \
596 __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \
597 __asm__ ( "fldcw %0" : : "m" (mask) ); \
600 #define START_FAST_MATH(x) \
602 static GLuint mask = FAST_X86_FPU; \
603 __asm__ ( "fnstcw %0" : "=m" (*&(x)) ); \
604 __asm__ ( "fldcw %0" : : "m" (mask) ); \
607 /* Restore original FPU mode, and clear any exceptions that may have
608 * occurred in the FAST_MATH block.
610 #define END_FAST_MATH(x) \
612 __asm__ ( "fnclex ; fldcw %0" : : "m" (*&(x)) ); \
615 #elif defined(__WATCOMC__) && defined(__386__)
616 #define DEFAULT_X86_FPU 0x037f /* See GCC comments above */
617 #define FAST_X86_FPU 0x003f /* See GCC comments above */
618 void _watcom_start_fast_math(unsigned short *x
,unsigned short *mask
);
619 #pragma aux _watcom_start_fast_math = \
620 "fnstcw word ptr [eax]" \
621 "fldcw word ptr [ecx]" \
624 void _watcom_end_fast_math(unsigned short *x
);
625 #pragma aux _watcom_end_fast_math = \
627 "fldcw word ptr [eax]" \
630 #if defined(NO_FAST_MATH)
631 #define START_FAST_MATH(x) \
633 static GLushort mask = DEFAULT_X86_FPU; \
634 _watcom_start_fast_math(&x,&mask); \
637 #define START_FAST_MATH(x) \
639 static GLushort mask = FAST_X86_FPU; \
640 _watcom_start_fast_math(&x,&mask); \
643 #define END_FAST_MATH(x) _watcom_end_fast_math(&x)
645 #define START_FAST_MATH(x) x = 0
646 #define END_FAST_MATH(x) (void)(x)
651 /**********************************************************************
656 _mesa_malloc( size_t bytes
);
659 _mesa_calloc( size_t bytes
);
662 _mesa_free( void *ptr
);
665 _mesa_align_malloc( size_t bytes
, unsigned long alignment
);
668 _mesa_align_calloc( size_t bytes
, unsigned long alignment
);
671 _mesa_align_free( void *ptr
);
674 _mesa_realloc( void *oldBuffer
, size_t oldSize
, size_t newSize
);
677 _mesa_memcpy( void *dest
, const void *src
, size_t n
);
680 _mesa_memset( void *dst
, int val
, size_t n
);
683 _mesa_memset16( unsigned short *dst
, unsigned short val
, size_t n
);
686 _mesa_bzero( void *dst
, size_t n
);
696 _mesa_sqrtd(double x
);
699 _mesa_sqrtf(float x
);
702 _mesa_inv_sqrtf(float x
);
705 _mesa_pow(double x
, double y
);
711 _mesa_bitcount(unsigned int n
);
714 _mesa_float_to_half(float f
);
717 _mesa_half_to_float(GLhalfARB h
);
721 _mesa_getenv( const char *var
);
724 _mesa_strstr( const char *haystack
, const char *needle
);
727 _mesa_strncat( char *dest
, const char *src
, size_t n
);
730 _mesa_strcpy( char *dest
, const char *src
);
733 _mesa_strncpy( char *dest
, const char *src
, size_t n
);
736 _mesa_strlen( const char *s
);
739 _mesa_strcmp( const char *s1
, const char *s2
);
742 _mesa_strncmp( const char *s1
, const char *s2
, size_t n
);
745 _mesa_strdup( const char *s
);
748 _mesa_atoi( const char *s
);
751 _mesa_strtod( const char *s
, char **end
);
754 _mesa_sprintf( char *str
, const char *fmt
, ... );
757 _mesa_printf( const char *fmtString
, ... );
761 _mesa_warning( __GLcontext
*gc
, const char *fmtString
, ... );
764 _mesa_problem( const __GLcontext
*ctx
, const char *fmtString
, ... );
767 _mesa_error( __GLcontext
*ctx
, GLenum error
, const char *fmtString
, ... );
770 _mesa_debug( const __GLcontext
*ctx
, const char *fmtString
, ... );
774 _mesa_init_default_imports( __GLimports
*imports
, void *driverCtx
);
782 #endif /* IMPORTS_H */