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

Andres Gomez agomez at igalia.com
Thu Aug 2 07:09:48 UTC 2018


On Wed, 2018-08-01 at 15:31 -0700, Dylan Baker wrote:
> I pushed a patch earlier that *should* make mkdir and getpid work with msvc

Thanks for the heads up. I'll drop this patch, then.

> 
> Dylan
> 
> Quoting Andres Gomez (2018-08-01 11:53:04)
> > 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 ...
> > 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);
> > +#else
> > +   fprintf(stderr, "dd: can't create a directory (%i)\n", errno);
> > +#endif
> >  
> >     if (verbose)
> >        fprintf(stderr, "dd: dumping to file %s\n", buf);
> > -- 
> > 2.18.0
> > 
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-- 
Br,

Andres


More information about the mesa-dev mailing list