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

2018-08-02 Thread Andres Gomez
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 
> > Cc: Brian Paul 
> > Cc: Roland Scheidegger 
> > Cc: Nicolai Hähnle 
> > Signed-off-by: Andres Gomez 
> > ---
> >  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() - 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@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-- 
Br,

Andres
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2018-08-01 Thread Dylan Baker
I pushed a patch earlier that *should* make mkdir and getpid work with msvc

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 
> Cc: Brian Paul 
> Cc: Roland Scheidegger 
> Cc: Nicolai Hähnle 
> Signed-off-by: Andres Gomez 
> ---
>  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() - 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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


signature.asc
Description: signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


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

2018-08-01 Thread Andres Gomez
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 
Cc: Brian Paul 
Cc: Roland Scheidegger 
Cc: Nicolai Hähnle 
Signed-off-by: Andres Gomez 
---
 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() - 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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev