Mesa (staging/20.2): u_debug_stack_test: Fix MSVC compiling by using ATTRIBUTE_NOINLINE

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Aug 18 17:43:32 UTC 2020


Module: Mesa
Branch: staging/20.2
Commit: ed256fd8042b2383b8d0ebc1631abbecdc56073e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed256fd8042b2383b8d0ebc1631abbecdc56073e

Author: Jesse Natalie <jenatali at microsoft.com>
Date:   Thu Aug 13 10:33:29 2020 -0700

u_debug_stack_test: Fix MSVC compiling by using ATTRIBUTE_NOINLINE

Fixes: d0d14f3f ("util: Add unit test for stack backtrace caputure")

Reviewed-by: Kristian H. Kristensen <hoegsberg at google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6303>
(cherry picked from commit 58af31186a806c8f18cf92dad454bb5f46daa9e2)

---

 .pick_status.json               | 2 +-
 src/util/u_debug_stack_test.cpp | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index d87b5efe123..7963f23b4b6 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1597,7 +1597,7 @@
         "description": "u_debug_stack_test: Fix MSVC compiling by using ATTRIBUTE_NOINLINE",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "d0d14f3f6481e015b4413fa0487164b76fe45296"
     },
diff --git a/src/util/u_debug_stack_test.cpp b/src/util/u_debug_stack_test.cpp
index 6add3e989b2..b9a563488c0 100644
--- a/src/util/u_debug_stack_test.cpp
+++ b/src/util/u_debug_stack_test.cpp
@@ -24,9 +24,10 @@
 #include <stdio.h>
 #include <gtest/gtest.h>
 
+#include "util/macros.h"
 #include "util/u_debug_stack.h"
 
-static void __attribute__((noinline))
+static void ATTRIBUTE_NOINLINE
 func_a(void)
 {
    struct debug_stack_frame backtrace[16];
@@ -36,7 +37,7 @@ func_a(void)
    debug_backtrace_dump(backtrace, 16);
 }
 
-static void __attribute__((noinline))
+static void ATTRIBUTE_NOINLINE
 func_b(void)
 {
    struct debug_stack_frame backtrace[16];
@@ -48,7 +49,7 @@ func_b(void)
    debug_backtrace_dump(backtrace, 16);
 }
 
-static void __attribute__((noinline))
+static void ATTRIBUTE_NOINLINE
 func_c(struct debug_stack_frame *frames)
 {
    debug_backtrace_capture(frames, 0, 16);



More information about the mesa-commit mailing list