Skip to content

Commit 59905c7

Browse files
authored
Prevent redefinition of ssize_t (yhirose#2319)
On Windows cpp-httplib defines ssize_t, therefore applications needing to define ssize_t for their own needs or are using libraries that do require a means to avoid a possible incompatible redefinition. Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
1 parent 8d03ef1 commit 59905c7

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

httplib.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@
205205

206206
#pragma comment(lib, "ws2_32.lib")
207207

208+
#ifndef _SSIZE_T_DEFINED
208209
using ssize_t = __int64;
210+
#define _SSIZE_T_DEFINED
211+
#endif
209212
#endif // _MSC_VER
210213

211214
#ifndef S_ISREG

0 commit comments

Comments
 (0)