Module: Mesa
Branch: master
Commit: 65d1040435005ea01c9e18d00f937d9be0a90839
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=65d1040435005ea01c9e18d00f937d9be0a90839

Author: Brian Paul <bri...@vmware.com>
Date:   Fri Apr 13 15:32:48 2018 -0600

ddebug: add PIPE_OS_UNIX/LINUX checks to fix MSVC build

Don't include Unix headers or use Unix functions when building with MSVC.

Reviewed-by: Marek Olšák <marek.ol...@amd.com>
Reviewed-by: Charmaine Lee <charmai...@vmware.com>

---

 src/gallium/auxiliary/driver_ddebug/dd_draw.c | 5 +++++
 src/gallium/auxiliary/driver_ddebug/dd_util.h | 9 +++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/gallium/auxiliary/driver_ddebug/dd_draw.c 
b/src/gallium/auxiliary/driver_ddebug/dd_draw.c
index c404ea0607..cb5db8ab83 100644
--- a/src/gallium/auxiliary/driver_ddebug/dd_draw.c
+++ b/src/gallium/auxiliary/driver_ddebug/dd_draw.c
@@ -37,6 +37,7 @@
 #include "tgsi/tgsi_scan.h"
 #include "util/os_time.h"
 #include <inttypes.h>
+#include "pipe/p_config.h"
 
 
 static void
@@ -69,6 +70,7 @@ dd_get_file_stream(struct dd_screen *dscreen, unsigned 
apitrace_call_number)
 static void
 dd_dump_dmesg(FILE *f)
 {
+#ifdef PIPE_OS_LINUX
    char line[2000];
    FILE *p = popen("dmesg | tail -n60", "r");
 
@@ -80,6 +82,7 @@ dd_dump_dmesg(FILE *f)
       fputs(line, f);
 
    pclose(p);
+#endif
 }
 
 static unsigned
@@ -611,7 +614,9 @@ dd_dump_call(FILE *f, struct dd_draw_state *state, struct 
dd_call *call)
 static void
 dd_kill_process(void)
 {
+#ifdef PIPE_OS_UNIX
    sync();
+#endif
    fprintf(stderr, "dd: Aborting the process...\n");
    fflush(stdout);
    fflush(stderr);
diff --git a/src/gallium/auxiliary/driver_ddebug/dd_util.h 
b/src/gallium/auxiliary/driver_ddebug/dd_util.h
index bdfb7cc916..8953e34d58 100644
--- a/src/gallium/auxiliary/driver_ddebug/dd_util.h
+++ b/src/gallium/auxiliary/driver_ddebug/dd_util.h
@@ -30,14 +30,19 @@
 
 #include <stdio.h>
 #include <errno.h>
-#include <unistd.h>
-#include <sys/stat.h>
 
 #include "c99_alloca.h"
 #include "os/os_process.h"
 #include "util/u_atomic.h"
 #include "util/u_debug.h"
 
+#include "pipe/p_config.h"
+#ifdef PIPE_OS_UNIX
+#include <unistd.h>
+#include <sys/stat.h>
+#endif
+
+
 /* name of the directory in home */
 #define DD_DIR "ddebug_dumps"
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to