From 8967a7364889fff4491e5494ca51e2abe08f0cec Mon Sep 17 00:00:00 2001 From: Kevin Wasserman Date: Tue, 6 Jan 2015 08:16:51 -0500 Subject: [PATCH] use _read() instead of read() on windows --- json_gssapi/main.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/json_gssapi/main.cpp b/json_gssapi/main.cpp index fb7f28a..be5f227 100644 --- a/json_gssapi/main.cpp +++ b/json_gssapi/main.cpp @@ -1,15 +1,20 @@ // #include +#include #ifdef WIN32 #include #include #include #else #include -#include #endif #include +#ifdef WIN32 +#define gssweb_read _read +#else +#define gssweb_read read +#endif using std::cin; using std::cout; @@ -38,7 +43,7 @@ int main(int argc, char **argv) { readThisRound = readTotal = 0; while(4 != readTotal) { - readThisRound = _read(0, ((&len) + readTotal), 4 - readTotal); + readThisRound = gssweb_read(0, ((&len) + readTotal), 4 - readTotal); readTotal += readThisRound; } @@ -48,7 +53,7 @@ int main(int argc, char **argv) { while (readTotal < len) { readRemaining = len - readTotal; - readThisRound = _read( 0, &(input[readTotal]), readRemaining); + readThisRound = gssweb_read( 0, &(input[readTotal]), readRemaining); if (-1 == readThisRound) break; else -- 2.1.4