[vala/meson-msvc: 12/18] build: Add Visual Studio compat headers
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/meson-msvc: 12/18] build: Add Visual Studio compat headers
- Date: Fri, 28 Jan 2022 08:50:36 +0000 (UTC)
commit 89f72af327ba275a7a5f192f23e653d0d2a4f5ed
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Mon Jan 24 19:35:40 2022 +0800
build: Add Visual Studio compat headers
Visual Studio does not come with unistd.h and utime.h, so building items
that originate from glib-2.0.vapi et al will fail if items that depend
on these headers are used.
Do overcome this, add compat headers for them that will include the
appropriate headers from Visual Studio (or the Windows SDK), to fix the
build.
msvc/unistd.h | 10 ++++++++++
msvc/utime.h | 7 +++++++
2 files changed, 17 insertions(+)
---
diff --git a/msvc/unistd.h b/msvc/unistd.h
new file mode 100644
index 000000000..7ba841347
--- /dev/null
+++ b/msvc/unistd.h
@@ -0,0 +1,10 @@
+/* Compatbility header for Visual Studio-like builds */
+
+#ifndef _MSC_VER
+# error This header is for Visual Studio-like builds only
+#endif
+
+#include <direct.h>
+#include <io.h>
+#include <process.h>
+
diff --git a/msvc/utime.h b/msvc/utime.h
new file mode 100644
index 000000000..3fdf86fa8
--- /dev/null
+++ b/msvc/utime.h
@@ -0,0 +1,7 @@
+/* compat header for MSVC builds */
+
+#ifndef _MSC_VER
+#error This compat header is for Visual Studio-like builds only
+#endif
+
+#include <sys/utime.h>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]