quic: fixup NO_ERROR macro conflict on windows · nodejs/node@c8b64bd · GitHub
Skip to content

Commit c8b64bd

Browse files
committed
quic: fixup NO_ERROR macro conflict on windows
PR-URL: #59381 Fixes: #59369 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <richard.lau@ibm.com>
1 parent e2fefd7 commit c8b64bd

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/quic/data.cc

Lines changed: 2 additions & 0 deletions

src/quic/data.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ class Store final : public MemoryRetainer {
108108

109109
// Periodically, these need to be updated to match the latest ngtcp2 defs.
110110
#define QUIC_TRANSPORT_ERRORS(V) \
111-
V(NO_ERROR) \
112111
V(INTERNAL_ERROR) \
113112
V(CONNECTION_REFUSED) \
114113
V(FLOW_CONTROL_ERROR) \
@@ -155,6 +154,10 @@ class QuicError final : public MemoryRetainer {
155154
public:
156155
// The known error codes for the transport namespace.
157156
enum class TransportError : error_code {
157+
// NO_ERROR has to be treated specially since it is a macro on
158+
// some Windows cases and results in a compile error if we leave
159+
// it as is.
160+
NO_ERROR_ = NGTCP2_NO_ERROR,
158161
#define V(name) name = NGTCP2_##name,
159162
QUIC_TRANSPORT_ERRORS(V)
160163
#undef V
@@ -273,6 +276,7 @@ class QuicError final : public MemoryRetainer {
273276

274277
static const QuicError FromConnectionClose(ngtcp2_conn* session);
275278

279+
static const QuicError TRANSPORT_NO_ERROR;
276280
#define V(name) static const QuicError TRANSPORT_##name;
277281
QUIC_TRANSPORT_ERRORS(V)
278282
#undef V

test/cctest/test_quic_error.cc

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)