Amend some macro comments
This commit is contained in:
parent
5fa1938691
commit
aaa0b858e4
|
@ -24,8 +24,8 @@
|
||||||
*/
|
*/
|
||||||
#include "asio_common.h"
|
#include "asio_common.h"
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "template.h"
|
#include "template.h"
|
||||||
|
|
|
@ -34,9 +34,9 @@ struct iovec {
|
||||||
void *iov_base; /* Pointer to data. */
|
void *iov_base; /* Pointer to data. */
|
||||||
size_t iov_len; /* Length of data. */
|
size_t iov_len; /* Length of data. */
|
||||||
};
|
};
|
||||||
#else
|
#else // !_WIN32
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#endif // _WIN32
|
#endif // !_WIN32
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
|
@ -35,9 +35,9 @@
|
||||||
#endif // HAVE_SYS_SOCKET_H
|
#endif // HAVE_SYS_SOCKET_H
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
#else
|
#else // !_WIN32
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
#endif // _WIN32
|
#endif // !_WIN32
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif // HAVE_NETINET_IN_H
|
#endif // HAVE_NETINET_IN_H
|
||||||
|
|
16
src/util.cc
16
src/util.cc
|
@ -44,9 +44,9 @@
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <ws2tcpip.h>
|
#include <ws2tcpip.h>
|
||||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||||
#else
|
#else // !_WIN32
|
||||||
#include <netinet/tcp.h>
|
#include <netinet/tcp.h>
|
||||||
#endif // _WIN32
|
#endif // !_WIN32
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif // HAVE_ARPA_INET_H
|
#endif // HAVE_ARPA_INET_H
|
||||||
|
@ -397,14 +397,14 @@ time_t parse_http_date(const StringRef &s) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return boost::posix_time::to_time_t(ltime);
|
return boost::posix_time::to_time_t(ltime);
|
||||||
#else
|
#else // !_WIN32
|
||||||
tm tm{};
|
tm tm{};
|
||||||
char *r = strptime(s.c_str(), "%a, %d %b %Y %H:%M:%S GMT", &tm);
|
char *r = strptime(s.c_str(), "%a, %d %b %Y %H:%M:%S GMT", &tm);
|
||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return nghttp2_timegm_without_yday(&tm);
|
return nghttp2_timegm_without_yday(&tm);
|
||||||
#endif // _WIN32
|
#endif // !_WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
char upcase(char c) {
|
char upcase(char c) {
|
||||||
|
@ -869,7 +869,7 @@ int make_socket_closeonexec(int fd) {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
(void)fd;
|
(void)fd;
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else // !_WIN32
|
||||||
int flags;
|
int flags;
|
||||||
int rv;
|
int rv;
|
||||||
while ((flags = fcntl(fd, F_GETFD)) == -1 && errno == EINTR)
|
while ((flags = fcntl(fd, F_GETFD)) == -1 && errno == EINTR)
|
||||||
|
@ -877,7 +877,7 @@ int make_socket_closeonexec(int fd) {
|
||||||
while ((rv = fcntl(fd, F_SETFD, flags | FD_CLOEXEC)) == -1 && errno == EINTR)
|
while ((rv = fcntl(fd, F_SETFD, flags | FD_CLOEXEC)) == -1 && errno == EINTR)
|
||||||
;
|
;
|
||||||
return rv;
|
return rv;
|
||||||
#endif // _WIN32
|
#endif // !_WIN32
|
||||||
}
|
}
|
||||||
|
|
||||||
int make_socket_nonblocking(int fd) {
|
int make_socket_nonblocking(int fd) {
|
||||||
|
@ -887,13 +887,13 @@ int make_socket_nonblocking(int fd) {
|
||||||
u_long mode = 1;
|
u_long mode = 1;
|
||||||
|
|
||||||
rv = ioctlsocket(fd, FIONBIO, &mode);
|
rv = ioctlsocket(fd, FIONBIO, &mode);
|
||||||
#else
|
#else // !_WIN32
|
||||||
int flags;
|
int flags;
|
||||||
while ((flags = fcntl(fd, F_GETFL, 0)) == -1 && errno == EINTR)
|
while ((flags = fcntl(fd, F_GETFL, 0)) == -1 && errno == EINTR)
|
||||||
;
|
;
|
||||||
while ((rv = fcntl(fd, F_SETFL, flags | O_NONBLOCK)) == -1 && errno == EINTR)
|
while ((rv = fcntl(fd, F_SETFL, flags | O_NONBLOCK)) == -1 && errno == EINTR)
|
||||||
;
|
;
|
||||||
#endif // _WIN32
|
#endif // !_WIN32
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue