forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
protobuf.patch
426 lines (397 loc) · 17 KB
/
protobuf.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
diff --git a/BUILD.bazel b/BUILD.bazel
index 42175b5ed..8b313e0f6 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -222,14 +222,79 @@ alias(
visibility = ["//visibility:public"],
)
+# Envoy: Patch
+
cc_binary(
- name = "protoc",
+ name = "compiled_protoc",
copts = COPTS,
linkopts = LINK_OPTS,
visibility = ["//visibility:public"],
deps = ["//src/google/protobuf/compiler:protoc_lib"],
)
+# Lifted from `rules_proto`
+config_setting(
+ name = "linux-aarch_64",
+ constraint_values = [
+ "@platforms//os:linux",
+ "@platforms//cpu:aarch64",
+ ],
+)
+
+config_setting(
+ name = "linux-x86_64",
+ constraint_values = [
+ "@platforms//os:linux",
+ "@platforms//cpu:x86_64",
+ ],
+)
+
+config_setting(
+ name = "osx-aarch_64",
+ constraint_values = [
+ "@platforms//os:osx",
+ "@platforms//cpu:aarch64",
+ ],
+)
+
+config_setting(
+ name = "osx-x86_64",
+ constraint_values = [
+ "@platforms//os:osx",
+ "@platforms//cpu:x86_64",
+ ],
+)
+
+config_setting(
+ name = "win64",
+ constraint_values = [
+ "@platforms//os:windows",
+ "@platforms//cpu:x86_64",
+ ],
+)
+
+# Use precompiled binaries where possible.
+alias(
+ name = "protoc",
+ actual = select({
+ ":linux-aarch_64": "@com_google_protobuf_protoc_linux_aarch_64//:protoc",
+ ":linux-x86_64": "@com_google_protobuf_protoc_linux_x86_64//:protoc",
+ ":osx-aarch_64": "@com_google_protobuf_protoc_osx_aarch_64//:protoc",
+ ":osx-x86_64": "@com_google_protobuf_protoc_osx_x86_64//:protoc",
+ ":win64": "@com_google_protobuf_protoc_win64//:protoc",
+ "//conditions:default": ":compiled_protoc",
+ }),
+ visibility = ["//visibility:public"],
+)
+
+alias(
+ name = "protobuf_python_genproto",
+ actual = "//python:well_known_types_py_pb2_genproto",
+ visibility = ["//visibility:public"],
+)
+
+# /Envoy: Patch
+
cc_binary(
name = "protoc_static",
copts = COPTS,
diff --git a/protobuf.bzl b/protobuf.bzl
index 9a0589789..ee6b93ba3 100644
--- a/protobuf.bzl
+++ b/protobuf.bzl
@@ -99,6 +99,10 @@ def _proto_gen_impl(ctx):
if ctx.attr.includes:
for include in ctx.attr.includes:
+ if include == ".":
+ # This is effectively source_dir, which has already been handled,
+ # and may be generated incorrectly here.
+ continue
import_flags += ["-I" + _GetPath(ctx, include)]
import_flags = depset(direct = import_flags)
diff --git a/python/google/protobuf/__init__.py b/python/google/protobuf/__init__.py
index 022974824..418779fd2 100755
--- a/python/google/protobuf/__init__.py
+++ b/python/google/protobuf/__init__.py
@@ -8,3 +8,10 @@
# Copyright 2007 Google Inc. All Rights Reserved.
__version__ = '5.28.2'
+
+
+if __name__ != '__main__':
+ try:
+ __import__('pkg_resources').declare_namespace(__name__)
+ except ImportError:
+ __path__ = __import__('pkgutil').extend_path(__path__, __name__)
diff --git a/src/google/protobuf/compiler/BUILD.bazel b/src/google/protobuf/compiler/BUILD.bazel
index 3f5624d5f..e194b172f 100644
--- a/src/google/protobuf/compiler/BUILD.bazel
+++ b/src/google/protobuf/compiler/BUILD.bazel
@@ -517,7 +517,7 @@ cc_library(
srcs = ["retention.cc"],
hdrs = ["retention.h"],
strip_include_prefix = "/src",
- visibility = ["//src/google/protobuf:__subpackages__"],
+ visibility = ["//visibility:public"],
deps = [
"//src/google/protobuf",
"//src/google/protobuf:port",
diff --git a/src/google/protobuf/generated_message_tctable_lite.cc b/src/google/protobuf/generated_message_tctable_lite.cc
index 155efbbbc..591f91596 100644
--- a/src/google/protobuf/generated_message_tctable_lite.cc
+++ b/src/google/protobuf/generated_message_tctable_lite.cc
@@ -518,7 +518,7 @@ PROTOBUF_NOINLINE const char* TcParser::FastGtR2(PROTOBUF_TC_PARAM_DECL) {
//////////////////////////////////////////////////////////////////////////////
template <typename LayoutType, typename TagType>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularFixed(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularFixed(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -548,7 +548,7 @@ PROTOBUF_NOINLINE const char* TcParser::FastF64S2(PROTOBUF_TC_PARAM_DECL) {
}
template <typename LayoutType, typename TagType>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedFixed(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedFixed(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -583,7 +583,7 @@ PROTOBUF_NOINLINE const char* TcParser::FastF64R2(PROTOBUF_TC_PARAM_DECL) {
}
template <typename LayoutType, typename TagType>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::PackedFixed(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::PackedFixed(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -714,8 +714,8 @@ inline int64_t ZigZagDecodeHelper<int64_t, true>(int64_t value) {
// Prefetch the enum data, if necessary.
// We can issue the prefetch before we start parsing the ints.
-PROTOBUF_ALWAYS_INLINE void PrefetchEnumData(uint16_t xform_val,
- TcParseTableBase::FieldAux aux) {
+inline PROTOBUF_ALWAYS_INLINE void PrefetchEnumData(
+ uint16_t xform_val, TcParseTableBase::FieldAux aux) {
}
// When `xform_val` is a constant, we want to inline `ValidateEnum` because it
@@ -726,8 +726,8 @@ PROTOBUF_ALWAYS_INLINE void PrefetchEnumData(uint16_t xform_val,
// way more common than the kTvEnum cases. It is also called from places that
// already have out-of-line functions (like MpVarint) so an extra out-of-line
// call to `ValidateEnum` does not affect much.
-PROTOBUF_ALWAYS_INLINE bool EnumIsValidAux(int32_t val, uint16_t xform_val,
- TcParseTableBase::FieldAux aux) {
+inline PROTOBUF_ALWAYS_INLINE bool EnumIsValidAux(
+ int32_t val, uint16_t xform_val, TcParseTableBase::FieldAux aux) {
if (xform_val == field_layout::kTvRange) {
auto lo = aux.enum_range.start;
return lo <= val && val < (lo + aux.enum_range.length);
@@ -742,7 +742,7 @@ PROTOBUF_ALWAYS_INLINE bool EnumIsValidAux(int32_t val, uint16_t xform_val,
} // namespace
template <typename FieldType, typename TagType, bool zigzag>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularVarint(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularVarint(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -803,7 +803,7 @@ PROTOBUF_NOINLINE const char* TcParser::SingularVarBigint(
}
template <typename FieldType>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::FastVarintS1(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::FastVarintS1(
PROTOBUF_TC_PARAM_DECL) {
using TagType = uint8_t;
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
@@ -886,7 +886,7 @@ PROTOBUF_NOINLINE const char* TcParser::FastZ64S2(PROTOBUF_TC_PARAM_DECL) {
}
template <typename FieldType, typename TagType, bool zigzag>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedVarint(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedVarint(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -951,7 +951,7 @@ PROTOBUF_NOINLINE const char* TcParser::FastZ64R2(PROTOBUF_TC_PARAM_DECL) {
}
template <typename FieldType, typename TagType, bool zigzag>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::PackedVarint(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::PackedVarint(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -1053,7 +1053,7 @@ PROTOBUF_NOINLINE const char* TcParser::MpUnknownEnumFallback(
}
template <typename TagType, uint16_t xform_val>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularEnum(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularEnum(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -1095,7 +1095,7 @@ PROTOBUF_NOINLINE const char* TcParser::FastEvS2(PROTOBUF_TC_PARAM_DECL) {
}
template <typename TagType, uint16_t xform_val>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedEnum(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedEnum(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -1147,7 +1147,7 @@ PROTOBUF_NOINLINE void TcParser::AddUnknownEnum(MessageLite* msg,
}
template <typename TagType, uint16_t xform_val>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::PackedEnum(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::PackedEnum(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -1204,7 +1204,7 @@ PROTOBUF_NOINLINE const char* TcParser::FastEvP2(PROTOBUF_TC_PARAM_DECL) {
}
template <typename TagType, uint8_t min>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularEnumSmallRange(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularEnumSmallRange(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -1242,7 +1242,7 @@ PROTOBUF_NOINLINE const char* TcParser::FastEr1S2(PROTOBUF_TC_PARAM_DECL) {
}
template <typename TagType, uint8_t min>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedEnumSmallRange(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedEnumSmallRange(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -1284,7 +1284,7 @@ PROTOBUF_NOINLINE const char* TcParser::FastEr1R2(PROTOBUF_TC_PARAM_DECL) {
}
template <typename TagType, uint8_t min>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::PackedEnumSmallRange(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::PackedEnumSmallRange(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -1399,7 +1399,7 @@ PROTOBUF_ALWAYS_INLINE inline bool IsValidUTF8(ArenaStringPtr& field) {
} // namespace
template <typename TagType, typename FieldType, TcParser::Utf8Type utf8>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularString(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::SingularString(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -1507,7 +1507,7 @@ const char* TcParser::FastUcS2(PROTOBUF_TC_PARAM_DECL) {
}
template <typename TagType, typename FieldType, TcParser::Utf8Type utf8>
-PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedString(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::RepeatedString(
PROTOBUF_TC_PARAM_DECL) {
if (PROTOBUF_PREDICT_FALSE(data.coded_tag<TagType>() != 0)) {
PROTOBUF_MUSTTAIL return MiniParse(PROTOBUF_TC_PARAM_NO_DATA_PASS);
@@ -2207,7 +2207,7 @@ PROTOBUF_NOINLINE const char* TcParser::MpString(PROTOBUF_TC_PARAM_DECL) {
PROTOBUF_MUSTTAIL return ToTagDispatch(PROTOBUF_TC_PARAM_NO_DATA_PASS);
}
-PROTOBUF_ALWAYS_INLINE const char* TcParser::ParseRepeatedStringOnce(
+inline PROTOBUF_ALWAYS_INLINE const char* TcParser::ParseRepeatedStringOnce(
const char* ptr, SerialArena* serial_arena, ParseContext* ctx,
RepeatedPtrField<std::string>& field) {
int size = ReadSize(&ptr);
diff --git a/src/google/protobuf/io/BUILD.bazel b/src/google/protobuf/io/BUILD.bazel
index 66819966b..446d75420 100644
--- a/src/google/protobuf/io/BUILD.bazel
+++ b/src/google/protobuf/io/BUILD.bazel
@@ -158,7 +158,7 @@ cc_library(
"@com_google_absl//absl/log:absl_log",
] + select({
"//build_defs:config_msvc": [],
- "//conditions:default": ["@zlib"],
+ "//conditions:default": ["@envoy//bazel/foreign_cc:zlib"],
}),
)
diff --git a/src/google/protobuf/map.cc b/src/google/protobuf/map.cc
index 97cf262ea..df6b413d8 100644
--- a/src/google/protobuf/map.cc
+++ b/src/google/protobuf/map.cc
@@ -120,7 +120,7 @@ void UntypedMapBase::ClearTable(const ClearInput input) {
ABSL_DCHECK_NE(num_buckets_, kGlobalEmptyTableSize);
if (alloc_.arena() == nullptr) {
- const auto loop = [=](auto destroy_node) {
+ const auto loop = [&, this](auto destroy_node) {
const TableEntryPtr* table = table_;
for (map_index_t b = index_of_first_non_null_, end = num_buckets_;
b < end; ++b) {
diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
index 37d80e591..c17f61a76 100644
--- a/src/google/protobuf/port_def.inc
+++ b/src/google/protobuf/port_def.inc
@@ -856,7 +856,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
#pragma clang diagnostic ignored "-Wshorten-64-to-32"
// Turn on -Wdeprecated-enum-enum-conversion. This deprecation comes in C++20
// via http://wg21.link/p1120r0.
-#pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
+// #pragma clang diagnostic error "-Wdeprecated-enum-enum-conversion"
// This error has been generally flaky, but we need to disable it specifically
// to fix https://github.com/protocolbuffers/protobuf/issues/12313
#pragma clang diagnostic ignored "-Wunused-parameter"
@@ -925,7 +925,8 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
#pragma warning(disable: 4125)
#endif
-#if PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII
+#if defined(PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII) && \
+ PROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII
#define PROTOBUF_DEBUG true
#else
#define PROTOBUF_DEBUG false
diff --git a/src/google/protobuf/wire_format_lite.cc b/src/google/protobuf/wire_format_lite.cc
index f6d97df6c..eeaaa8318 100644
--- a/src/google/protobuf/wire_format_lite.cc
+++ b/src/google/protobuf/wire_format_lite.cc
@@ -664,9 +664,11 @@ static size_t VarintSize(const T* data, const int n) {
if (x > 0x1FFFFF) sum++;
if (x > 0xFFFFFFF) sum++;
}
+#ifdef __clang__
// Clang is not smart enough to see that this loop doesn't run many times
// NOLINTNEXTLINE(google3-runtime-pragma-loop-hint): b/315043579
#pragma clang loop vectorize(disable) unroll(disable) interleave(disable)
+#endif
for (; i < n; i++) {
uint32_t x = data[i];
if (ZigZag) {
@@ -706,9 +708,11 @@ static size_t VarintSize64(const T* data, const int n) {
if (x > 0x1FFFFF) sum++;
if (x > 0xFFFFFFF) sum++;
}
+#ifdef __clang__
// Clang is not smart enough to see that this loop doesn't run many times
// NOLINTNEXTLINE(google3-runtime-pragma-loop-hint): b/315043579
#pragma clang loop vectorize(disable) unroll(disable) interleave(disable)
+#endif
for (; i < n; i++) {
uint64_t x = data[i];
if (ZigZag) {
diff --git a/upb/message/internal/accessors.h b/upb/message/internal/accessors.h
index 5bbfb1e0b..6c6da17fd 100644
--- a/upb/message/internal/accessors.h
+++ b/upb/message/internal/accessors.h
@@ -163,7 +163,7 @@ UPB_INLINE void UPB_PRIVATE(_upb_Message_SetPresence)(
}
}
-UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataCopy)(
+UPB_INLINE_IF_NOT_GCC void UPB_PRIVATE(_upb_MiniTableField_DataCopy)(
const upb_MiniTableField* f, void* to, const void* from) {
switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) {
case kUpb_FieldRep_1Byte:
@@ -183,7 +183,7 @@ UPB_INLINE void UPB_PRIVATE(_upb_MiniTableField_DataCopy)(
UPB_UNREACHABLE();
}
-UPB_INLINE bool UPB_PRIVATE(_upb_MiniTableField_DataEquals)(
+UPB_INLINE_IF_NOT_GCC bool UPB_PRIVATE(_upb_MiniTableField_DataEquals)(
const upb_MiniTableField* f, const void* a, const void* b) {
switch (UPB_PRIVATE(_upb_MiniTableField_GetRep)(f)) {
case kUpb_FieldRep_1Byte:
diff --git a/upb/port/def.inc b/upb/port/def.inc
index 6aa1835f4..9a2545bd0 100644
--- a/upb/port/def.inc
+++ b/upb/port/def.inc
@@ -81,6 +81,12 @@ Error, UINTPTR_MAX is undefined
#define UPB_INLINE static
#endif
+#if defined(__GNUC__) && !defined(__clang__)
+#define UPB_INLINE_IF_NOT_GCC static
+#else
+#define UPB_INLINE_IF_NOT_GCC UPB_INLINE
+#endif
+
#ifdef UPB_BUILD_API
#define UPB_API UPB_EXPORT
#define UPB_API_INLINE UPB_EXPORT
diff --git a/upb/port/undef.inc b/upb/port/undef.inc
index d8453ffec..4240e5923 100644
--- a/upb/port/undef.inc
+++ b/upb/port/undef.inc
@@ -12,6 +12,7 @@
#undef UPB_MAPTYPE_STRING
#undef UPB_EXPORT
#undef UPB_INLINE
+#undef UPB_INLINE_IF_NOT_GCC
#undef UPB_API
#undef UPB_API_INLINE
#undef UPB_ALIGN_UP