Skip to content

Commit be413ac

Browse files
committed
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 <winerror.h>. PR-URL: node-forward/node#57 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Rod Vagg <[email protected]>
1 parent 355b96b commit be413ac

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/node_zlib.cc

+10-10
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ enum node_zlib_mode {
6464
};
6565

6666
enum node_zlib_error {
67-
NO_ERROR,
68-
FAILED,
69-
WRITE_PENDING
67+
kNoError,
68+
kFailed,
69+
kWritePending
7070
};
7171

7272
void InitZlib(v8::Handle<v8::Object> target);
@@ -208,7 +208,7 @@ class ZCtx : public AsyncWrap {
208208
if (!async) {
209209
// sync version
210210
Process(work_req);
211-
if (CheckError(ctx) == NO_ERROR)
211+
if (CheckError(ctx) == kNoError)
212212
AfterSync(ctx, args);
213213
return;
214214
}
@@ -305,18 +305,18 @@ class ZCtx : public AsyncWrap {
305305
ZCtx::Error(ctx, "Missing dictionary");
306306
else
307307
ZCtx::Error(ctx, "Bad dictionary");
308-
return FAILED;
308+
return kFailed;
309309
default:
310310
// something else.
311311
if (ctx->strm_.total_out == 0) {
312312
ZCtx::Error(ctx, "Zlib error");
313-
return FAILED;
313+
return kFailed;
314314
} else {
315-
return WRITE_PENDING;
315+
return kWritePending;
316316
}
317317
}
318318

319-
return NO_ERROR;
319+
return kNoError;
320320
}
321321

322322

@@ -331,7 +331,7 @@ class ZCtx : public AsyncWrap {
331331
Context::Scope context_scope(env->context());
332332

333333
node_zlib_error error = CheckError(ctx);
334-
if (error == FAILED)
334+
if (error == kFailed)
335335
return;
336336

337337
Local<Integer> avail_out = Integer::New(env->isolate(),
@@ -345,7 +345,7 @@ class ZCtx : public AsyncWrap {
345345
Local<Value> args[2] = { avail_in, avail_out };
346346
ctx->MakeCallback(env->callback_string(), ARRAY_SIZE(args), args);
347347

348-
if (error == WRITE_PENDING) {
348+
if (error == kWritePending) {
349349
ZCtx::Error(ctx, "Zlib error");
350350
return;
351351
}

0 commit comments

Comments
 (0)