32 #if defined(_WIN32) && !defined(__MINGW32CE__)
41 static int win32_open(
const char *filename_utf8,
int oflag,
int pmode)
48 num_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename_utf8, -1, NULL, 0);
51 filename_w =
av_mallocz(
sizeof(
wchar_t) * num_chars);
56 MultiByteToWideChar(CP_UTF8, 0, filename_utf8, -1, filename_w, num_chars);
58 fd = _wsopen(filename_w, oflag, SH_DENYNO, pmode);
61 if (fd != -1 || (oflag & O_CREAT))
66 return _sopen(filename_utf8, oflag, SH_DENYNO, pmode);
68 #define open win32_open
74 unsigned int mode = 0;
79 mode = va_arg(ap,
unsigned int);
86 fd = open(filename, flags, mode);
89 if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
common internal API header
memory handling functions
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...