[Mesa-dev] [PATCH 2/6] gallium/aux/util: use util_snprintf() in test_texture_barrier

Andres Gomez agomez at igalia.com
Wed Aug 1 18:53:01 UTC 2018


Instead of plain snprintf(). To fix the MSVC 2013 build:

  Compiling src\gallium\auxiliary\util\u_tests.c ...
u_tests.c
src\gallium\auxiliary\util\u_tests.c(624) : warning C4013: 'snprintf' undefined; assuming extern returning int

...

gallium.lib(u_tests.obj) : error LNK2019: unresolved external symbol _snprintf referenced in function _test_texture_barrier
build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll : fatal error LNK1120: 1 unresolved externals
scons: *** [build\windows-x86-debug\gallium\targets\graw-gdi\graw.dll] Error 1120
scons: building terminated because of errors.

Fixes: 56342c97ee7 ("gallium/u_tests: test FBFETCH and shader-based blending with MSAA")
Cc: Marek Olšák <marek.olsak at amd.com>
Cc: Brian Paul <brianp at vmware.com>
Cc: Roland Scheidegger <sroland at vmware.com>
Cc: Dieter Nützel <Dieter at nuetzel-hh.de>
Signed-off-by: Andres Gomez <agomez at igalia.com>
---
 src/gallium/auxiliary/util/u_tests.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c
index f8c001813c1..7360eb97639 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -622,8 +622,8 @@ test_texture_barrier(struct pipe_context *ctx, bool use_fbfetch,
 
    assert(num_samples >= 1 && num_samples <= 8);
 
-   snprintf(name, sizeof(name), "%s: %s, %u samples", __func__,
-            use_fbfetch ? "FBFETCH" : "sampler", MAX2(num_samples, 1));
+   util_snprintf(name, sizeof(name), "%s: %s, %u samples", __func__,
+                 use_fbfetch ? "FBFETCH" : "sampler", MAX2(num_samples, 1));
 
    if (!ctx->screen->get_param(ctx->screen, PIPE_CAP_TEXTURE_BARRIER)) {
       util_report_result_helper(SKIP, name);
-- 
2.18.0



More information about the mesa-dev mailing list