mesa: fix Windows build error related to getuid()
authorBrian Paul <brianp@vmware.com>
Wed, 19 Apr 2017 18:13:36 +0000 (12:13 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 20 Apr 2017 01:55:29 +0000 (19:55 -0600)
getuid() and geteuid() are not present on Windows.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/context.c

index 984c9e00bbfc3fcc5de458d37eb1be0f1f72c6a4..3570f94f5a5de61f59173112237598a50a10675c 100644 (file)
@@ -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();