protect unistd.h with #if HAVE_UNISTD_H in code from recent av_bprint_fd_contents...
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 7 Jul 2014 23:45:43 +0000 (01:45 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 7 Jul 2014 23:54:30 +0000 (01:54 +0200)
Should fix build failure on MSVC

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavdevice/lavfi.c
libavutil/bprint.c

index 9be2d0e..f96fe83 100644 (file)
@@ -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"
 #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;
index becb4d8..4fd902e 100644 (file)
@@ -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"
 #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)