ref: 92b7e8bd536228b145e6c315987a4908bea3b38a
parent: 150b4e2c575670c8827765e91793816aae758523
author: Steve Lhomme <slhomme@videolan.org>
date: Thu Sep 27 10:00:43 EDT 2018
detect unistd.h availability It doesn't exist on MSVC and it's not needed.
--- a/meson.build
+++ b/meson.build
@@ -137,6 +137,10 @@
cdata.set('HAVE_ALIGNED_MALLOC', 1)
endif
+if cc.check_header('unistd.h')
+ cdata.set('HAVE_UNISTD_H', 1)
+endif
+
if (get_option('buildtype') != 'debug' and
get_option('buildtype') != 'plain')
add_project_arguments('-fomit-frame-pointer', '-ffast-math',
--- a/tools/dav1d.c
+++ b/tools/dav1d.c
@@ -32,7 +32,9 @@
#include <math.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include "dav1d/data.h"
--- a/tools/dav1d_cli_parse.c
+++ b/tools/dav1d_cli_parse.c
@@ -34,7 +34,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include "dav1d_cli_parse.h"