diff options
Diffstat (limited to 'mesalib/src/mesa/drivers/dri/common')
-rwxr-xr-x[-rw-r--r--] | mesalib/src/mesa/drivers/dri/common/dri_util.c | 69 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/dri/common/xmlconfig.c | 16 |
2 files changed, 46 insertions, 39 deletions
diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c index c28b0fc41..7f84e6496 100644..100755 --- a/mesalib/src/mesa/drivers/dri/common/dri_util.c +++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c @@ -113,6 +113,7 @@ dri2CreateNewScreen2(int scrn, int fd, { static const __DRIextension *emptyExtensionList[] = { NULL }; __DRIscreen *psp; + int gl_version_override; psp = calloc(1, sizeof(*psp)); if (!psp) @@ -159,7 +160,7 @@ dri2CreateNewScreen2(int scrn, int fd, return NULL; } - int gl_version_override = _mesa_get_gl_version_override(); + gl_version_override = _mesa_get_gl_version_override(); if (gl_version_override >= 31) { psp->max_gl_core_version = MAX2(psp->max_gl_core_version, gl_version_override); @@ -306,6 +307,8 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api, unsigned major_version = 1; unsigned minor_version = 0; uint32_t flags = 0; + unsigned i; + struct gl_context *ctx; assert((num_attribs == 0) || (attribs != NULL)); @@ -333,7 +336,7 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api, return NULL; } - for (unsigned i = 0; i < num_attribs; i++) { + for (i = 0; i < num_attribs; i++) { switch (attribs[i * 2]) { case __DRI_CTX_ATTRIB_MAJOR_VERSION: major_version = attribs[i * 2 + 1]; @@ -429,7 +432,7 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api, return NULL; } - struct gl_context *ctx = context->driverPrivate; + ctx = context->driverPrivate; if ((flags & __DRI_CTX_FLAG_FORWARD_COMPATIBLE) != 0) ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT; if ((flags & __DRI_CTX_FLAG_DEBUG) != 0) { @@ -719,36 +722,36 @@ driSwapBuffers(__DRIdrawable *pdp) /** Core interface */ const __DRIcoreExtension driCoreExtension = { - .base = { __DRI_CORE, __DRI_CORE_VERSION }, - - .createNewScreen = NULL, - .destroyScreen = driDestroyScreen, - .getExtensions = driGetExtensions, - .getConfigAttrib = driGetConfigAttrib, - .indexConfigAttrib = driIndexConfigAttrib, - .createNewDrawable = NULL, - .destroyDrawable = driDestroyDrawable, - .swapBuffers = driSwapBuffers, /* swrast */ - .createNewContext = dri2CreateNewContext, /* swrast */ - .copyContext = driCopyContext, - .destroyContext = driDestroyContext, - .bindContext = driBindContext, - .unbindContext = driUnbindContext + /*.base =*/ { __DRI_CORE, __DRI_CORE_VERSION }, + + /*.createNewScreen =*/ NULL, + /*.destroyScreen =*/ driDestroyScreen, + /*.getExtensions =*/ driGetExtensions, + /*.getConfigAttrib =*/ driGetConfigAttrib, + /*.indexConfigAttrib =*/ driIndexConfigAttrib, + /*.createNewDrawable =*/ NULL, + /*.destroyDrawable =*/ driDestroyDrawable, + /*.swapBuffers =*/ driSwapBuffers, /* swrast */ + /*.createNewContext =*/ dri2CreateNewContext, /* swrast */ + /*.copyContext =*/ driCopyContext, + /*.destroyContext =*/ driDestroyContext, + /*.bindContext =*/ driBindContext, + /*.unbindContext =*/ driUnbindContext }; /** DRI2 interface */ const __DRIdri2Extension driDRI2Extension = { - .base = { __DRI_DRI2, 4 }, - - .createNewScreen = dri2CreateNewScreen, - .createNewDrawable = dri2CreateNewDrawable, - .createNewContext = dri2CreateNewContext, - .getAPIMask = dri2GetAPIMask, - .createNewContextForAPI = dri2CreateNewContextForAPI, - .allocateBuffer = dri2AllocateBuffer, - .releaseBuffer = dri2ReleaseBuffer, - .createContextAttribs = dri2CreateContextAttribs, - .createNewScreen2 = dri2CreateNewScreen2, + /*.base =*/ { __DRI_DRI2, 4 }, + + /*.createNewScreen =*/ dri2CreateNewScreen, + /*.createNewDrawable =*/ dri2CreateNewDrawable, + /*.createNewContext =*/ dri2CreateNewContext, + /*.getAPIMask =*/ dri2GetAPIMask, + /*.createNewContextForAPI =*/ dri2CreateNewContextForAPI, + /*.allocateBuffer =*/ dri2AllocateBuffer, + /*.releaseBuffer =*/ dri2ReleaseBuffer, + /*.createContextAttribs =*/ dri2CreateContextAttribs, + /*.createNewScreen2 =*/ dri2CreateNewScreen2, }; const __DRIswrastExtension driSWRastExtension = { @@ -761,11 +764,11 @@ const __DRIswrastExtension driSWRastExtension = { }; const __DRI2configQueryExtension dri2ConfigQueryExtension = { - .base = { __DRI2_CONFIG_QUERY, __DRI2_CONFIG_QUERY_VERSION }, + /*.base =*/ { __DRI2_CONFIG_QUERY, __DRI2_CONFIG_QUERY_VERSION }, - .configQueryb = dri2ConfigQueryb, - .configQueryi = dri2ConfigQueryi, - .configQueryf = dri2ConfigQueryf, + /*.configQueryb =*/ dri2ConfigQueryb, + /*.configQueryi =*/ dri2ConfigQueryi, + /*.configQueryf =*/ dri2ConfigQueryf, }; void diff --git a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c index b95e452f1..cce47c753 100644 --- a/mesalib/src/mesa/drivers/dri/common/xmlconfig.c +++ b/mesalib/src/mesa/drivers/dri/common/xmlconfig.c @@ -101,7 +101,11 @@ static const char *__getProgramName () { # define GET_PROGRAM_NAME() __getProgramName() # else # define GET_PROGRAM_NAME() "" +# ifdef _MSC_VER +# pragma message("Per application configuration won't work with your OS version.") +# else # warning "Per application configuration won't work with your OS version." +# endif # endif #endif @@ -438,11 +442,11 @@ __driUtilMessage(const char *f, ...) (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser)); \ } while (0) -#define XML_WARNING(msg,args...) do { \ +#define XML_WARNING(msg, ...) do { \ __driUtilMessage ("Warning in %s line %d, column %d: "msg, data->name, \ (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser), \ - args); \ + __VA_ARGS__); \ } while (0) /** \brief Output an error message. */ #define XML_ERROR1(msg) do { \ @@ -450,11 +454,11 @@ __driUtilMessage(const char *f, ...) (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser)); \ } while (0) -#define XML_ERROR(msg,args...) do { \ +#define XML_ERROR(msg, ...) do { \ __driUtilMessage ("Error in %s line %d, column %d: "msg, data->name, \ (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser), \ - args); \ + __VA_ARGS__); \ } while (0) /** \brief Output a fatal error message and abort. */ #define XML_FATAL1(msg) do { \ @@ -464,12 +468,12 @@ __driUtilMessage(const char *f, ...) (int) XML_GetCurrentColumnNumber(data->parser)); \ abort();\ } while (0) -#define XML_FATAL(msg,args...) do { \ +#define XML_FATAL(msg, ...) do { \ fprintf (stderr, "Fatal error in %s line %d, column %d: "msg"\n", \ data->name, \ (int) XML_GetCurrentLineNumber(data->parser), \ (int) XML_GetCurrentColumnNumber(data->parser), \ - args); \ + __VA_ARGS__); \ abort();\ } while (0) |