mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Fix Windows build problem
This commit is contained in:
parent
ba6845925d
commit
8311e1105f
@ -2054,6 +2054,10 @@ inline uint64_t Response::get_header_value_u64(const std::string &key,
|
|||||||
|
|
||||||
inline void default_socket_options(socket_t sock) {
|
inline void default_socket_options(socket_t sock) {
|
||||||
int opt = 1;
|
int opt = 1;
|
||||||
|
#ifdef _WIN32
|
||||||
|
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
|
||||||
|
reinterpret_cast<const char *>(&opt), sizeof(opt));
|
||||||
|
#else
|
||||||
#ifdef SO_REUSEPORT
|
#ifdef SO_REUSEPORT
|
||||||
setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
|
setsockopt(sock, SOL_SOCKET, SO_REUSEPORT,
|
||||||
reinterpret_cast<const void *>(&opt), sizeof(opt));
|
reinterpret_cast<const void *>(&opt), sizeof(opt));
|
||||||
@ -2061,6 +2065,7 @@ inline void default_socket_options(socket_t sock) {
|
|||||||
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
|
setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
|
||||||
reinterpret_cast<const void *>(&opt), sizeof(opt));
|
reinterpret_cast<const void *>(&opt), sizeof(opt));
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const char *status_message(int status) {
|
inline const char *status_message(int status) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user