]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/file.c
configure: Support MSVC 2015
[ffmpeg] / libavutil / file.c
index 77aaca0fc0c6de8162b5e73b0ade3c4db0fd4edb..18a110aeeb4ac0c03b1265f712bc2df979390ca5 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "config.h"
 #include "file.h"
+#include "internal.h"
 #include "log.h"
+#include "mem.h"
 #include <fcntl.h>
 #include <sys/stat.h>
+#if HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+#if HAVE_IO_H
+#include <io.h>
+#endif
 #if HAVE_MMAP
 #include <sys/mman.h>
 #elif HAVE_MAPVIEWOFFILE
-#include <io.h>
 #include <windows.h>
 #endif
 
-typedef struct {
+typedef struct FileLogContext {
     const AVClass *class;
     int   log_offset;
     void *log_ctx;
@@ -43,7 +50,7 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
                 int log_offset, void *log_ctx)
 {
     FileLogContext file_log_ctx = { &file_log_ctx_class, log_offset, log_ctx };
-    int err, fd = open(filename, O_RDONLY);
+    int err, fd = avpriv_open(filename, O_RDONLY);
     struct stat st;
     av_unused void *ptr;
     off_t off_size;