1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avformat/internal: Don't auto-include os_support.h

It includes various Windows-specific headers when compiling
for Windows and these sometimes cause issues: E.g. winbase.h
defines IGNORE, which clashes with a macro used in the Matroska
muxer (since 884653ee5b) and demuxer.

This header provides fallback defines for various stuff that is
mostly not used directly by (de)muxers at all:
mkdir, rename, rmdir, unlink, access, poll, pollfd, nfds_t,
closesocket, socklen_t, fstat, stat, lseek, SHUT_(RD|WR|RDWR)
and various POLL* constants.

Ergo fix this issue by not auto-including this header in lots
of places via an inclusion in internal.h and instead include
it everywhere where the above stuff is used (most of these
translation units already included os_support.h).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-08-31 19:28:10 +02:00
parent 25ecc94d58
commit ee485b4051
4 changed files with 3 additions and 1 deletions

View File

@ -36,6 +36,7 @@
#include "avio_internal.h" #include "avio_internal.h"
#include "internal.h" #include "internal.h"
#include "img2.h" #include "img2.h"
#include "os_support.h"
#include "libavcodec/jpegxl_parse.h" #include "libavcodec/jpegxl_parse.h"
#include "libavcodec/mjpeg.h" #include "libavcodec/mjpeg.h"
#include "libavcodec/vbn.h" #include "libavcodec/vbn.h"

View File

@ -26,7 +26,6 @@
#include "libavcodec/packet_internal.h" #include "libavcodec/packet_internal.h"
#include "avformat.h" #include "avformat.h"
#include "os_support.h"
#define MAX_URL_SIZE 4096 #define MAX_URL_SIZE 4096

View File

@ -28,6 +28,7 @@
#include "network.h" #include "network.h"
#include "httpauth.h" #include "httpauth.h"
#include "internal.h" #include "internal.h"
#include "os_support.h"
#include "libavutil/log.h" #include "libavutil/log.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"

View File

@ -37,6 +37,7 @@
#if CONFIG_NETWORK #if CONFIG_NETWORK
#include "network.h" #include "network.h"
#endif #endif
#include "os_support.h"
static AVMutex avformat_mutex = AV_MUTEX_INITIALIZER; static AVMutex avformat_mutex = AV_MUTEX_INITIALIZER;