[FFmpeg-devel] [PATCH v5 4/6] avformat/network: add ff_neterror2() for compatibility with Windows

Andrew Sayers ffmpeg-devel at pileofstuff.org
Thu May 16 14:59:09 EEST 2024


This is not currently used anywhere, but included to avoid
potential future surprises.
---
 libavformat/network.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/network.h b/libavformat/network.h
index 1ac067f09f..7c8f81a050 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -82,6 +82,12 @@ int ff_neterror2(int err);
  * @note Error is based on WSAGetLastError() (Windows) or `errno` (otherwise)
  */
 #define ff_neterror() AVERROR(errno)
+/*
+ * @brief ff_neterror()-style AVERROR
+ * @param err error code (usually an errno or Windows Sockets Error Code)
+ * @note Windows Sockets Error Codes are only supported in Windows
+ */
+#define ff_neterror2(ERRNO) AVERROR(ERRNO)
 #endif /* HAVE_WINSOCK2_H */
 
 #if HAVE_ARPA_INET_H
-- 
2.43.0



More information about the ffmpeg-devel mailing list