Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6553202

Browse filesBrowse files
jasnelladuh95
authored andcommitted
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 6df1508 commit 6553202
Copy full SHA for 6553202

3 files changed

+8-2Lines changed: 8 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/quic/data.cc‎

Copy file name to clipboardExpand all lines: src/quic/data.cc
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ const QuicError QuicError::FromConnectionClose(ngtcp2_conn* session) {
386386
QUIC_TRANSPORT_ERRORS(V)
387387
#undef V
388388

389+
const QuicError QuicError::TRANSPORT_NO_ERROR =
390+
ForTransport(TransportError::NO_ERROR_);
389391
const QuicError QuicError::HTTP3_NO_ERROR = ForApplication(NGHTTP3_H3_NO_ERROR);
390392
const QuicError QuicError::VERSION_NEGOTIATION = ForVersionNegotiation();
391393
const QuicError QuicError::IDLE_CLOSE = ForIdleClose();
Collapse file

‎src/quic/data.h‎

Copy file name to clipboardExpand all lines: src/quic/data.h
+5-1Lines 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
Collapse file

‎test/cctest/test_quic_error.cc‎

Copy file name to clipboardExpand all lines: test/cctest/test_quic_error.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ TEST(QuicError, NoError) {
1616
CHECK_EQ(err.reason(), "");
1717
CHECK_EQ(err, QuicError::TRANSPORT_NO_ERROR);
1818

19-
CHECK_EQ(QuicError::TransportError::NO_ERROR, QuicError::QUIC_NO_ERROR);
19+
CHECK_EQ(QuicError::TransportError::NO_ERROR_, QuicError::QUIC_NO_ERROR);
2020
CHECK_EQ(QuicError::Http3Error::H3_NO_ERROR, QuicError::HTTP3_NO_ERROR_CODE);
2121

2222
QuicError err2("a reason");

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.