Skip to content

Commit 924a557

Browse files
committed
Changed to use 'using' instead of 'typedef'
1 parent d8da740 commit 924a557

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

httplib.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767

6868
#if defined(_MSC_VER)
6969
#ifdef _WIN64
70-
typedef __int64 ssize_t;
70+
using ssize_t = __int64;
7171
#else
72-
typedef int ssize_t;
72+
using ssize_t = int;
7373
#endif
7474

7575
#if _MSC_VER < 1900
@@ -105,7 +105,7 @@ typedef int ssize_t;
105105
#define strcasecmp _stricmp
106106
#endif // strcasecmp
107107

108-
typedef SOCKET socket_t;
108+
using socket_t = SOCKET;
109109
#ifdef CPPHTTPLIB_USE_POLL
110110
#define poll(fds, nfds, timeout) WSAPoll(fds, nfds, timeout)
111111
#endif
@@ -125,7 +125,7 @@ typedef SOCKET socket_t;
125125
#include <sys/socket.h>
126126
#include <unistd.h>
127127

128-
typedef int socket_t;
128+
using socket_t = int;
129129
#define INVALID_SOCKET (-1)
130130
#endif //_WIN32
131131

@@ -539,9 +539,8 @@ class Server {
539539
size_t payload_max_length_;
540540

541541
private:
542-
typedef std::vector<std::pair<std::regex, Handler>> Handlers;
543-
typedef std::vector<std::pair<std::regex, HandlerWithContentReader>>
544-
HandersForContentReader;
542+
using Handlers = std::vector<std::pair<std::regex, Handler>>;
543+
using HandersForContentReader = std::vector<std::pair<std::regex, HandlerWithContentReader>>;
545544

546545
socket_t create_server_socket(const char *host, int port,
547546
int socket_flags) const;

0 commit comments

Comments
 (0)