From 04e4a14edcc5032949b19c338157ea956a52830b Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Wed, 19 May 2021 16:19:31 -0600 Subject: [PATCH] Define HAVE_UNISTD_H on Darwin/macOS: Fixes a compiler failure due to missing function prototype. --- configure | 1 + configure.ac | 1 + src/slirp/slirp.h | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/configure b/configure index dfcded4..9075b97 100755 --- a/configure +++ b/configure @@ -6310,6 +6310,7 @@ case "$host" in LIBS="$LIBS -framework OpenGL" LIBS="$LIBS -framework OpenAL" build_macosx="yes" + CFLAGS="$CFLAGS -DHAVE_UNISTD_H" ;; *-*-cygwin* | *-*-mingw32*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lopengl32" >&5 diff --git a/configure.ac b/configure.ac index 20a6d09..3a89aff 100644 --- a/configure.ac +++ b/configure.ac @@ -140,6 +140,7 @@ case "$host" in LIBS="$LIBS -framework OpenGL" LIBS="$LIBS -framework OpenAL" build_macosx="yes" + CFLAGS="$CFLAGS -DHAVE_UNISTD_H" ;; *-*-cygwin* | *-*-mingw32*) AC_CHECK_LIB([opengl32], [main], [], \ diff --git a/src/slirp/slirp.h b/src/slirp/slirp.h index 416b402..6e15943 100644 --- a/src/slirp/slirp.h +++ b/src/slirp/slirp.h @@ -80,6 +80,10 @@ typedef char *SLIRPcaddr_t; # include #endif +#ifdef HAVE_UNISTD_H +# include +#endif + #ifndef _MSC_VER #include #else