[Mesa-dev] [PATCH 5/6] ddebug: opt-out non UNIX code

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

Opt-out the code using mkdir() and getpid() which are spitting
warnings in the MSVC build:

  Compiling src\gallium\auxiliary\driver_ddebug\dd_draw.c ...
c:\projects\mesa\src\gallium\auxiliary\driver_ddebug\dd_util.h(62): warning C4013: 'mkdir' undefined; assuming extern returning int
c:\projects\mesa\src\gallium\auxiliary\driver_ddebug\dd_util.h(65): warning C4013: 'getpid' undefined; assuming extern returning int

Fixes: 6ff0c6f4ebc ("gallium: move ddebug, noop, rbug, trace to auxiliary to improve build times")
Cc: Marek Olšák <marek.olsak at amd.com>
Cc: Brian Paul <brianp at vmware.com>
Cc: Roland Scheidegger <sroland at vmware.com>
Cc: Nicolai Hähnle <nicolai.haehnle at amd.com>
Signed-off-by: Andres Gomez <agomez at igalia.com>
 src/gallium/auxiliary/driver_ddebug/dd_util.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/auxiliary/driver_ddebug/dd_util.h b/src/gallium/auxiliary/driver_ddebug/dd_util.h
index 7720e9af9ca..681627c83cb 100644
--- a/src/gallium/auxiliary/driver_ddebug/dd_util.h
+++ b/src/gallium/auxiliary/driver_ddebug/dd_util.h
@@ -60,11 +60,15 @@ dd_get_debug_filename_and_mkdir(char *buf, size_t buflen, bool verbose)
    util_snprintf(dir, sizeof(dir), "%s/"DD_DIR, debug_get_option("HOME", "."));
+#ifdef PIPE_OS_UNIX
    if (mkdir(dir, 0774) && errno != EEXIST)
       fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
    util_snprintf(buf, buflen, "%s/%s_%u_%08u", dir, proc_name, getpid(),
                  p_atomic_inc_return(&index) - 1);
+   fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
    if (verbose)
       fprintf(stderr, "dd: dumping to file %s\n", buf);

More information about the mesa-dev mailing list