[libdazzle: 5/7] build: unistd.h is not available on Windows




commit e2328892dd00164274a442a46c0f3317ad5f6103
Author: Tom Schoonjans <Tom Schoonjans rfi ac uk>
Date:   Sun Jun 27 06:51:41 2021 +0100

    build: unistd.h is not available on Windows

 src/graphing/dzl-cpu-model.c | 4 +++-
 src/util/dzl-counter.c       | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/graphing/dzl-cpu-model.c b/src/graphing/dzl-cpu-model.c
index e3af205..3e5b4a4 100644
--- a/src/graphing/dzl-cpu-model.c
+++ b/src/graphing/dzl-cpu-model.c
@@ -21,7 +21,9 @@
 #include <ctype.h>
 #include <fcntl.h>
 #include <stdlib.h>
-#include <unistd.h>
+#ifdef __linux__
+# include <unistd.h>
+#endif
 #include <stdio.h>
 #if defined(__FreeBSD__)
 # include <errno.h>
diff --git a/src/util/dzl-counter.c b/src/util/dzl-counter.c
index f57f936..f32eccb 100644
--- a/src/util/dzl-counter.c
+++ b/src/util/dzl-counter.c
@@ -30,7 +30,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
+#ifndef G_OS_WIN32
 #include <unistd.h>
+#endif
 
 #ifdef G_OS_UNIX
 # include <sys/mman.h>
@@ -148,6 +150,7 @@ dzl_counter_reset (DzlCounter *counter)
   DZL_MEMORY_BARRIER;
 }
 
+#ifndef G_OS_WIN32
 static void
 _dzl_counter_arena_atexit (void)
 {
@@ -158,6 +161,7 @@ _dzl_counter_arena_atexit (void)
   g_snprintf (name, sizeof name, NAME_FORMAT, pid);
   shm_unlink (name);
 }
+#endif
 
 static void
 _dzl_counter_arena_init_local (DzlCounterArena *arena)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]