From be413ac732f59ffe621f264239e5e22b77d32025 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 11 Nov 2014 12:06:55 +0100 Subject: [PATCH] src: fix windows build error Fix a Windows-only build error that was introduced in commit 1183ba4 ("zlib: support concatenated gzip files"). Rename the NO_ERROR and FAILED enumerations, they conflict with macros of the same name in . PR-URL: https://github.com/node-forward/node/pull/57 Reviewed-By: Fedor Indutny Reviewed-By: Rod Vagg --- src/node_zlib.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 65cf71e79c086b..5b8024330b0163 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -64,9 +64,9 @@ enum node_zlib_mode { }; enum node_zlib_error { - NO_ERROR, - FAILED, - WRITE_PENDING + kNoError, + kFailed, + kWritePending }; void InitZlib(v8::Handle target); @@ -208,7 +208,7 @@ class ZCtx : public AsyncWrap { if (!async) { // sync version Process(work_req); - if (CheckError(ctx) == NO_ERROR) + if (CheckError(ctx) == kNoError) AfterSync(ctx, args); return; } @@ -305,18 +305,18 @@ class ZCtx : public AsyncWrap { ZCtx::Error(ctx, "Missing dictionary"); else ZCtx::Error(ctx, "Bad dictionary"); - return FAILED; + return kFailed; default: // something else. if (ctx->strm_.total_out == 0) { ZCtx::Error(ctx, "Zlib error"); - return FAILED; + return kFailed; } else { - return WRITE_PENDING; + return kWritePending; } } - return NO_ERROR; + return kNoError; } @@ -331,7 +331,7 @@ class ZCtx : public AsyncWrap { Context::Scope context_scope(env->context()); node_zlib_error error = CheckError(ctx); - if (error == FAILED) + if (error == kFailed) return; Local avail_out = Integer::New(env->isolate(), @@ -345,7 +345,7 @@ class ZCtx : public AsyncWrap { Local args[2] = { avail_in, avail_out }; ctx->MakeCallback(env->callback_string(), ARRAY_SIZE(args), args); - if (error == WRITE_PENDING) { + if (error == kWritePending) { ZCtx::Error(ctx, "Zlib error"); return; }