Commit b41f378f authored by Peter Ross's avatar Peter Ross

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.
parent 876ed08b
...@@ -76,17 +76,7 @@ static inline int is_dos_path(const char *path) ...@@ -76,17 +76,7 @@ static inline int is_dos_path(const char *path)
return 0; return 0;
} }
#if defined(__OS2__)
#define SHUT_RD 0
#define SHUT_WR 1
#define SHUT_RDWR 2
#endif
#if defined(_WIN32) #if defined(_WIN32)
#define SHUT_RD SD_RECEIVE
#define SHUT_WR SD_SEND
#define SHUT_RDWR SD_BOTH
#ifndef S_IRUSR #ifndef S_IRUSR
#define S_IRUSR S_IREAD #define S_IRUSR S_IREAD
#endif #endif
...@@ -96,6 +86,19 @@ static inline int is_dos_path(const char *path) ...@@ -96,6 +86,19 @@ static inline int is_dos_path(const char *path)
#endif #endif
#if CONFIG_NETWORK #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 #if !HAVE_SOCKLEN_T
typedef int socklen_t; typedef int socklen_t;
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment