Mesa (main): util: limit error-dialogs to win32

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 8 13:50:17 UTC 2022


Module: Mesa
Branch: main
Commit: ae73a263551b7eae1b0182e991b2a309835acd6c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae73a263551b7eae1b0182e991b2a309835acd6c

Author: Erik Faye-Lund <erik.faye-lund at collabora.com>
Date:   Mon Mar 21 11:43:54 2022 +0100

util: limit error-dialogs to win32

These dialogs only exist on Windows, so let's not even expose a util
function for this on other platforms.

The code is only ever called from Windows specific code anyway.

While we're at it, clean up the name a bit as well.

Reviewed-by: Louis-Francis Ratté-Boulianne <lfrb at collabora.com>
Reviewed-by: Jesse Natalie <jenatali at microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15485>

---

 src/gallium/frontends/wgl/stw_device.c | 2 +-
 src/util/u_debug.c                     | 6 +++---
 src/util/u_debug.h                     | 6 ++++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/gallium/frontends/wgl/stw_device.c b/src/gallium/frontends/wgl/stw_device.c
index 52acb9e5c63..0ef057bce2f 100644
--- a/src/gallium/frontends/wgl/stw_device.c
+++ b/src/gallium/frontends/wgl/stw_device.c
@@ -120,7 +120,7 @@ stw_init(const struct stw_winsys *stw_winsys)
 {
    static struct stw_device stw_dev_storage;
 
-   debug_disable_error_message_boxes();
+   debug_disable_win32_error_dialogs();
 
    assert(!stw_dev);
 
diff --git a/src/util/u_debug.c b/src/util/u_debug.c
index 9c18928f82b..e5101bf431a 100644
--- a/src/util/u_debug.c
+++ b/src/util/u_debug.c
@@ -75,10 +75,10 @@ _util_debug_message(struct util_debug_callback *cb,
 }
 
 
+#ifdef _WIN32
 void
-debug_disable_error_message_boxes(void)
+debug_disable_win32_error_dialogs(void)
 {
-#ifdef _WIN32
    /* When Windows' error message boxes are disabled for this process (as is
     * typically the case when running tests in an automated fashion) we disable
     * CRT message boxes too.
@@ -97,8 +97,8 @@ debug_disable_error_message_boxes(void)
       _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
 #endif
    }
-#endif /* _WIN32 */
 }
+#endif /* _WIN32 */
 
 
 #ifdef DEBUG
diff --git a/src/util/u_debug.h b/src/util/u_debug.h
index c8e2f3dbfbf..9c4a4cfd091 100644
--- a/src/util/u_debug.h
+++ b/src/util/u_debug.h
@@ -177,13 +177,15 @@ void debug_print_blob( const char *name, const void *blob, unsigned size );
 #endif
 
 
+#ifdef _WIN32
 /**
- * Disable interactive error message boxes.
+ * Disable Win32 interactive error message boxes.
  *
  * Should be called as soon as possible for effectiveness.
  */
 void
-debug_disable_error_message_boxes(void);
+debug_disable_win32_error_dialogs(void);
+#endif
 
 
 /**



More information about the mesa-commit mailing list