summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2017-04-19 12:13:36 -0600
committerBrian Paul <[email protected]>2017-04-19 19:55:29 -0600
commit9bfecb03c597f043c19f40d8e509f8cc067502fc (patch)
tree0d392a0b75730fd66b9d849f842300330517d3c5
parentdd4488ea6ca89b863bf8608d59723a0b25585101 (diff)
mesa: fix Windows build error related to getuid()
getuid() and geteuid() are not present on Windows. Reviewed-by: Timothy Arceri <[email protected]>
-rw-r--r--src/mesa/main/context.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 984c9e00bbf..3570f94f5a5 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1211,8 +1211,12 @@ _mesa_initialize_context(struct gl_context *ctx,
/* KHR_no_error is likely to crash, overflow memory, etc if an application
* has errors so don't enable it for setuid processes.
*/
- if (getenv("MESA_NO_ERROR") && geteuid() == getuid())
- ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
+ if (getenv("MESA_NO_ERROR")) {
+#if !defined(_WIN32)
+ if (geteuid() == getuid())
+#endif
+ ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
+ }
/* setup the API dispatch tables with all nop functions */
ctx->OutsideBeginEnd = _mesa_alloc_dispatch_table();