From: Brian P. <br...@va...> - 2001-03-02 16:03:04
|
Gareth Hughes wrote: > > I think this is pretty fatal: > > static char * > _mesa_getenv(__GLcontext *gc, const char *var) > { > (void) gc; > return gc->imports.getenv(gc, var); > } > > void > _mesa_InitDefaultImports(__GLimports *imports, void *driverCtx, void > *other) > { > ... > imports->getenv = _mesa_getenv; > ... > } > > It seems that this: > > static void > _mesa_warning(__GLcontext *gc, char *str) > { > GLboolean debug; > #ifdef DEBUG > debug = GL_TRUE; > #else > /* Whacko XFree86 macro: > */ > #ifdef getenv > #undef getenv > #endif > if (gc->imports.getenv(gc, "MESA_DEBUG")) { > debug = GL_TRUE; > } > else { > debug = GL_FALSE; > } > #endif > if (debug) { > fprintf(stderr, "Mesa warning: %s\n", str); > } > } > > is preventing _mesa_getenv() from just calling getenv(), right? There's > obviously stuff going on here that I don't know about, so I'll leave it > up to you Brian. I've fixed it. It was just a silly mistake. The imports stuff is based on the OpenGL SI. The idea is that the __GLimports struct is OpenGL's interface to basic system functions such as stdio, memory allocation, getenv, etc. The goal is to make Mesa more interchangable with the SI. It's not done yet. -Brian |