[FFmpeg-cvslog] protect unistd.h with #if HAVE_UNISTD_H in code from recent av_bprint_fd_contents () patches

Michael Niedermayer git at videolan.org
Tue Jul 8 01:55:17 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jul  8 01:45:43 2014 +0200| [0ebcf878032fa32a02e406a3397b51dc8b45109d] | committer: Michael Niedermayer

protect unistd.h with #if HAVE_UNISTD_H in code from recent av_bprint_fd_contents() patches

Should fix build failure on MSVC

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ebcf878032fa32a02e406a3397b51dc8b45109d
---

 libavdevice/lavfi.c |    5 ++++-
 libavutil/bprint.c  |    6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 9be2d0e..f96fe83 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -27,7 +27,6 @@
 
 #include <float.h>              /* DBL_MIN, DBL_MAX */
 #include <fcntl.h>              /* O_RDONLY */
-#include <unistd.h>             /* close() */
 
 #include "libavutil/bprint.h"
 #include "libavutil/channel_layout.h"
@@ -43,6 +42,10 @@
 #include "libavformat/internal.h"
 #include "avdevice.h"
 
+#if HAVE_UNISTD_H
+#include <unistd.h>             /* close() */
+#endif
+
 typedef struct {
     AVClass *class;          ///< class for private options
     char          *graph_str;
diff --git a/libavutil/bprint.c b/libavutil/bprint.c
index becb4d8..4fd902e 100644
--- a/libavutil/bprint.c
+++ b/libavutil/bprint.c
@@ -22,7 +22,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <time.h>
-#include <unistd.h>
 #include "avassert.h"
 #include "avstring.h"
 #include "bprint.h"
@@ -31,6 +30,11 @@
 #include "error.h"
 #include "mem.h"
 
+#if HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+
 #define av_bprint_room(buf) ((buf)->size - FFMIN((buf)->len, (buf)->size))
 #define av_bprint_is_allocated(buf) ((buf)->str != (buf)->reserved_internal_buffer)
 



More information about the ffmpeg-cvslog mailing list