Skip to content

Commit 7e46465

Browse files
authored
Use ssize_t declared by toolchain when available (#320)
crtdefs.h already declares ssize_t.
1 parent 1b1a231 commit 7e46465

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

trantor/net/EventLoop.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
#include <windows.h>
2929
#include <io.h>
3030
#include <synchapi.h>
31+
#ifndef _SSIZE_T_DEFINED
3132
using ssize_t = long long;
33+
#endif
3234
#else
3335
#include <poll.h>
3436
#endif

trantor/utils/MsgBuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <assert.h>
2323
#include <string.h>
2424
#include <cstdint>
25-
#ifdef _WIN32
25+
#if defined(_WIN32) && !defined(_SSIZE_T_DEFINED)
2626
using ssize_t = std::intptr_t;
2727
#endif
2828

0 commit comments

Comments
 (0)