]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
build: Add Visual Studio compat headers
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 24 Jan 2022 11:35:40 +0000 (19:35 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 28 Jan 2022 08:16:43 +0000 (16:16 +0800)
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 [new file with mode: 0644]
msvc/utime.h [new file with mode: 0644]

diff --git a/msvc/unistd.h b/msvc/unistd.h
new file mode 100644 (file)
index 0000000..7ba8413
--- /dev/null
@@ -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 (file)
index 0000000..3fdf86f
--- /dev/null
@@ -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>