Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 93533e9

Browse files
bnoordhuischrisdickinson
authored andcommitted
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: #8893 Reviewed-By: Fedor Indutny <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-by: Timothy J Fontaine <[email protected]>
1 parent e93ff4f commit 93533e9

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);
@@ -212,7 +212,7 @@ class ZCtx : public AsyncWrap {
212212
if (!async) {
213213
// sync version
214214
Process(work_req);
215-
if (CheckError(ctx) == NO_ERROR)
215+
if (CheckError(ctx) == kNoError)
216216
AfterSync(ctx, args);
217217
return;
218218
}
@@ -310,18 +310,18 @@ class ZCtx : public AsyncWrap {
310310
ZCtx::Error(ctx, "Missing dictionary");
311311
else
312312
ZCtx::Error(ctx, "Bad dictionary");
313-
return FAILED;
313+
return kFailed;
314314
default:
315315
// something else.
316316
if (ctx->strm_.total_out == 0) {
317317
ZCtx::Error(ctx, "Zlib error");
318-
return FAILED;
318+
return kFailed;
319319
} else {
320-
return WRITE_PENDING;
320+
return kWritePending;
321321
}
322322
}
323323

324-
return NO_ERROR;
324+
return kNoError;
325325
}
326326

327327

@@ -336,7 +336,7 @@ class ZCtx : public AsyncWrap {
336336
Context::Scope context_scope(env->context());
337337

338338
node_zlib_error error = CheckError(ctx);
339-
if (error == FAILED)
339+
if (error == kFailed)
340340
return;
341341

342342
Local<Integer> avail_out = Integer::New(env->isolate(),
@@ -350,7 +350,7 @@ class ZCtx : public AsyncWrap {
350350
Local<Value> args[2] = { avail_in, avail_out };
351351
ctx->MakeCallback(env->callback_string(), ARRAY_SIZE(args), args);
352352

353-
if (error == WRITE_PENDING) {
353+
if (error == kWritePending) {
354354
ZCtx::Error(ctx, "Zlib error");
355355
return;
356356
}

0 commit comments

Comments
 (0)