diff options
author | Peter Ross <pross@xvid.org> | 2018-11-24 23:26:13 +1100 |
---|---|---|
committer | Peter Ross <pross@xvid.org> | 2018-12-11 22:08:18 +1100 |
commit | b41f378fc4ddb1a34aebe459805d3c8dbcc96b36 (patch) | |
tree | 421c1e75965076fbac84f1b756781660f15b221a /libavformat/os_support.h | |
parent | 876ed08b0d13dc163d84fb5f8365c5cd9060c326 (diff) | |
download | ffmpeg-b41f378fc4ddb1a34aebe459805d3c8dbcc96b36.tar.gz |
os_support: define socket shutdown SHUT_xxx macros if they are not defined
this section has been moved into the CONFIG_NETWORK block, since it only
affects network enabled builds.
sys/socket.h (with WIN32 guard) is needed to check if the SHUT_xxx macro exists.
Diffstat (limited to 'libavformat/os_support.h')
-rw-r--r-- | libavformat/os_support.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/libavformat/os_support.h b/libavformat/os_support.h index 7a56dc9a7c..5e6b32d2dc 100644 --- a/libavformat/os_support.h +++ b/libavformat/os_support.h @@ -76,17 +76,7 @@ static inline int is_dos_path(const char *path) return 0; } -#if defined(__OS2__) -#define SHUT_RD 0 -#define SHUT_WR 1 -#define SHUT_RDWR 2 -#endif - #if defined(_WIN32) -#define SHUT_RD SD_RECEIVE -#define SHUT_WR SD_SEND -#define SHUT_RDWR SD_BOTH - #ifndef S_IRUSR #define S_IRUSR S_IREAD #endif @@ -96,6 +86,19 @@ static inline int is_dos_path(const char *path) #endif #if CONFIG_NETWORK +#if defined(_WIN32) +#define SHUT_RD SD_RECEIVE +#define SHUT_WR SD_SEND +#define SHUT_RDWR SD_BOTH +#else +#include <sys/socket.h> +#if !defined(SHUT_RD) /* OS/2, DJGPP */ +#define SHUT_RD 0 +#define SHUT_WR 1 +#define SHUT_RDWR 2 +#endif +#endif + #if !HAVE_SOCKLEN_T typedef int socklen_t; #endif |