Skip to content

Commit dc693bc

Browse files
Auto-generate files after cl/966151323
1 parent d46a6ff commit dc693bc

5 files changed

Lines changed: 102 additions & 40 deletions

File tree

php/ext/google/protobuf/php-upb.c

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ Error, UINTPTR_MAX is undefined
495495

496496
/* aarch64 supports big and little endian modes; fasttable performs multibyte
497497
* tag loads assumes the tag of a varint is in the low bits. */
498-
#if (defined(__x86_64__) || defined(__AARCH64EL__)) && \
498+
#if !defined(_WIN32) && (defined(__x86_64__) || defined(__AARCH64EL__)) && \
499499
UPB_HAS_ATTRIBUTE(preserve_none) && UPB_HAS_ATTRIBUTE(musttail)
500500
#define UPB_FASTTABLE_SUPPORTED 1
501501
#else
@@ -514,7 +514,11 @@ Error, UINTPTR_MAX is undefined
514514
* This is useful for releasing code that might be used on multiple platforms,
515515
* for example the PHP or Ruby C extensions. */
516516
#elif defined(UPB_TRY_ENABLE_FASTTABLE)
517-
#define UPB_FASTTABLE UPB_FASTTABLE_SUPPORTED
517+
#if UPB_FASTTABLE_SUPPORTED
518+
#define UPB_FASTTABLE 1
519+
#else
520+
#define UPB_FASTTABLE 0
521+
#endif
518522
#else
519523
#define UPB_FASTTABLE 0
520524
#endif
@@ -568,6 +572,12 @@ Error, UINTPTR_MAX is undefined
568572
#define UPB_RETAIN
569573
#endif
570574

575+
#if defined(__GNUC__) || defined(__clang__)
576+
#define UPB_HIDDEN __attribute__((visibility("hidden")))
577+
#else
578+
#define UPB_HIDDEN
579+
#endif
580+
571581
// Linker arrays combine elements from multiple translation units into a single
572582
// array that can be iterated over at runtime.
573583
//
@@ -621,7 +631,7 @@ Error, UINTPTR_MAX is undefined
621631

622632
#elif defined(__MACH__)
623633

624-
/* As described in: https://stackoverflow.com/a/22366882 */
634+
/* As described in: https://stackoverflow.com/a/22366882 */
625635
#define UPB_LINKARR_APPEND(name) \
626636
__attribute__(( \
627637
section("__DATA,__la_" #name))) UPB_LINKARR_ATTR UPB_NO_SANITIZE_ADDRESS
@@ -640,10 +650,10 @@ Error, UINTPTR_MAX is undefined
640650

641651
#elif defined(_MSC_VER)
642652

643-
/* See:
644-
* https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
645-
* https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
646-
* https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
653+
/* See:
654+
* https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
655+
* https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
656+
* https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
647657
#define UPB_STRINGIFY_INTERNAL(x) #x
648658
#define UPB_STRINGIFY(x) UPB_STRINGIFY_INTERNAL(x)
649659
#define UPB_CONCAT(a, b, c) a##b##c
@@ -652,7 +662,7 @@ Error, UINTPTR_MAX is undefined
652662
#define UPB_LINKARR_APPEND(name) \
653663
__pragma(section(UPB_LINKARR_NAME(name, $j), read)) \
654664
__declspec(allocate(UPB_LINKARR_NAME(name, $j)))
655-
// clang-format off
665+
// clang-format off
656666
#define UPB_LINKARR_DECLARE(name, type) \
657667
__pragma(message(UPB_LINKARR_NAME(name, $j))) \
658668
__pragma(section(UPB_LINKARR_NAME(name, $a), read)) \
@@ -663,13 +673,13 @@ Error, UINTPTR_MAX is undefined
663673
type __stop_linkarr_##name; \
664674
UPB_LINKARR_APPEND(name) \
665675
__declspec(selectany) type UPB_linkarr_internal_empty_##name[1] = {0}
666-
// clang-format on
676+
// clang-format on
667677
#define UPB_LINKARR_START(name) (&__start_linkarr_##name)
668678
#define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
669679

670680
#else
671681

672-
// Linker arrays are not supported on this platform. Make macros no-ops.
682+
// Linker arrays are not supported on this platform. Make macros no-ops.
673683
#define UPB_LINKARR_APPEND(name)
674684
#define UPB_LINKARR_DECLARE(name, type) \
675685
UPB_STATIC_ASSERT(sizeof("__la_" #name) <= 17, \
@@ -19640,3 +19650,5 @@ const char* UPB_PRIVATE(_upb_WireReader_SkipGroup)(
1964019650
#undef _UPB_STRINGIFY
1964119651
#undef _UPB_STRINGIFY2
1964219652
#undef UPB_CONSTRUCTOR
19653+
#undef UPB_RETAIN
19654+
#undef UPB_HIDDEN

php/ext/google/protobuf/php-upb.h

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ Error, UINTPTR_MAX is undefined
494494

495495
/* aarch64 supports big and little endian modes; fasttable performs multibyte
496496
* tag loads assumes the tag of a varint is in the low bits. */
497-
#if (defined(__x86_64__) || defined(__AARCH64EL__)) && \
497+
#if !defined(_WIN32) && (defined(__x86_64__) || defined(__AARCH64EL__)) && \
498498
UPB_HAS_ATTRIBUTE(preserve_none) && UPB_HAS_ATTRIBUTE(musttail)
499499
#define UPB_FASTTABLE_SUPPORTED 1
500500
#else
@@ -513,7 +513,11 @@ Error, UINTPTR_MAX is undefined
513513
* This is useful for releasing code that might be used on multiple platforms,
514514
* for example the PHP or Ruby C extensions. */
515515
#elif defined(UPB_TRY_ENABLE_FASTTABLE)
516-
#define UPB_FASTTABLE UPB_FASTTABLE_SUPPORTED
516+
#if UPB_FASTTABLE_SUPPORTED
517+
#define UPB_FASTTABLE 1
518+
#else
519+
#define UPB_FASTTABLE 0
520+
#endif
517521
#else
518522
#define UPB_FASTTABLE 0
519523
#endif
@@ -567,6 +571,12 @@ Error, UINTPTR_MAX is undefined
567571
#define UPB_RETAIN
568572
#endif
569573

574+
#if defined(__GNUC__) || defined(__clang__)
575+
#define UPB_HIDDEN __attribute__((visibility("hidden")))
576+
#else
577+
#define UPB_HIDDEN
578+
#endif
579+
570580
// Linker arrays combine elements from multiple translation units into a single
571581
// array that can be iterated over at runtime.
572582
//
@@ -620,7 +630,7 @@ Error, UINTPTR_MAX is undefined
620630

621631
#elif defined(__MACH__)
622632

623-
/* As described in: https://stackoverflow.com/a/22366882 */
633+
/* As described in: https://stackoverflow.com/a/22366882 */
624634
#define UPB_LINKARR_APPEND(name) \
625635
__attribute__(( \
626636
section("__DATA,__la_" #name))) UPB_LINKARR_ATTR UPB_NO_SANITIZE_ADDRESS
@@ -639,10 +649,10 @@ Error, UINTPTR_MAX is undefined
639649

640650
#elif defined(_MSC_VER)
641651

642-
/* See:
643-
* https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
644-
* https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
645-
* https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
652+
/* See:
653+
* https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
654+
* https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
655+
* https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
646656
#define UPB_STRINGIFY_INTERNAL(x) #x
647657
#define UPB_STRINGIFY(x) UPB_STRINGIFY_INTERNAL(x)
648658
#define UPB_CONCAT(a, b, c) a##b##c
@@ -651,7 +661,7 @@ Error, UINTPTR_MAX is undefined
651661
#define UPB_LINKARR_APPEND(name) \
652662
__pragma(section(UPB_LINKARR_NAME(name, $j), read)) \
653663
__declspec(allocate(UPB_LINKARR_NAME(name, $j)))
654-
// clang-format off
664+
// clang-format off
655665
#define UPB_LINKARR_DECLARE(name, type) \
656666
__pragma(message(UPB_LINKARR_NAME(name, $j))) \
657667
__pragma(section(UPB_LINKARR_NAME(name, $a), read)) \
@@ -662,13 +672,13 @@ Error, UINTPTR_MAX is undefined
662672
type __stop_linkarr_##name; \
663673
UPB_LINKARR_APPEND(name) \
664674
__declspec(selectany) type UPB_linkarr_internal_empty_##name[1] = {0}
665-
// clang-format on
675+
// clang-format on
666676
#define UPB_LINKARR_START(name) (&__start_linkarr_##name)
667677
#define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
668678

669679
#else
670680

671-
// Linker arrays are not supported on this platform. Make macros no-ops.
681+
// Linker arrays are not supported on this platform. Make macros no-ops.
672682
#define UPB_LINKARR_APPEND(name)
673683
#define UPB_LINKARR_DECLARE(name, type) \
674684
UPB_STATIC_ASSERT(sizeof("__la_" #name) <= 17, \
@@ -19612,3 +19622,5 @@ UPB_PRIVATE(upb_WireWriter_VarintUnusedSizeFromLeadingZeros64)(uint64_t clz) {
1961219622
#undef _UPB_STRINGIFY
1961319623
#undef _UPB_STRINGIFY2
1961419624
#undef UPB_CONSTRUCTOR
19625+
#undef UPB_RETAIN
19626+
#undef UPB_HIDDEN

ruby/ext/google/protobuf_c/ruby-upb.c

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ Error, UINTPTR_MAX is undefined
495495

496496
/* aarch64 supports big and little endian modes; fasttable performs multibyte
497497
* tag loads assumes the tag of a varint is in the low bits. */
498-
#if (defined(__x86_64__) || defined(__AARCH64EL__)) && \
498+
#if !defined(_WIN32) && (defined(__x86_64__) || defined(__AARCH64EL__)) && \
499499
UPB_HAS_ATTRIBUTE(preserve_none) && UPB_HAS_ATTRIBUTE(musttail)
500500
#define UPB_FASTTABLE_SUPPORTED 1
501501
#else
@@ -514,7 +514,11 @@ Error, UINTPTR_MAX is undefined
514514
* This is useful for releasing code that might be used on multiple platforms,
515515
* for example the PHP or Ruby C extensions. */
516516
#elif defined(UPB_TRY_ENABLE_FASTTABLE)
517-
#define UPB_FASTTABLE UPB_FASTTABLE_SUPPORTED
517+
#if UPB_FASTTABLE_SUPPORTED
518+
#define UPB_FASTTABLE 1
519+
#else
520+
#define UPB_FASTTABLE 0
521+
#endif
518522
#else
519523
#define UPB_FASTTABLE 0
520524
#endif
@@ -568,6 +572,12 @@ Error, UINTPTR_MAX is undefined
568572
#define UPB_RETAIN
569573
#endif
570574

575+
#if defined(__GNUC__) || defined(__clang__)
576+
#define UPB_HIDDEN __attribute__((visibility("hidden")))
577+
#else
578+
#define UPB_HIDDEN
579+
#endif
580+
571581
// Linker arrays combine elements from multiple translation units into a single
572582
// array that can be iterated over at runtime.
573583
//
@@ -621,7 +631,7 @@ Error, UINTPTR_MAX is undefined
621631

622632
#elif defined(__MACH__)
623633

624-
/* As described in: https://stackoverflow.com/a/22366882 */
634+
/* As described in: https://stackoverflow.com/a/22366882 */
625635
#define UPB_LINKARR_APPEND(name) \
626636
__attribute__(( \
627637
section("__DATA,__la_" #name))) UPB_LINKARR_ATTR UPB_NO_SANITIZE_ADDRESS
@@ -640,10 +650,10 @@ Error, UINTPTR_MAX is undefined
640650

641651
#elif defined(_MSC_VER)
642652

643-
/* See:
644-
* https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
645-
* https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
646-
* https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
653+
/* See:
654+
* https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
655+
* https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
656+
* https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
647657
#define UPB_STRINGIFY_INTERNAL(x) #x
648658
#define UPB_STRINGIFY(x) UPB_STRINGIFY_INTERNAL(x)
649659
#define UPB_CONCAT(a, b, c) a##b##c
@@ -652,7 +662,7 @@ Error, UINTPTR_MAX is undefined
652662
#define UPB_LINKARR_APPEND(name) \
653663
__pragma(section(UPB_LINKARR_NAME(name, $j), read)) \
654664
__declspec(allocate(UPB_LINKARR_NAME(name, $j)))
655-
// clang-format off
665+
// clang-format off
656666
#define UPB_LINKARR_DECLARE(name, type) \
657667
__pragma(message(UPB_LINKARR_NAME(name, $j))) \
658668
__pragma(section(UPB_LINKARR_NAME(name, $a), read)) \
@@ -663,13 +673,13 @@ Error, UINTPTR_MAX is undefined
663673
type __stop_linkarr_##name; \
664674
UPB_LINKARR_APPEND(name) \
665675
__declspec(selectany) type UPB_linkarr_internal_empty_##name[1] = {0}
666-
// clang-format on
676+
// clang-format on
667677
#define UPB_LINKARR_START(name) (&__start_linkarr_##name)
668678
#define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
669679

670680
#else
671681

672-
// Linker arrays are not supported on this platform. Make macros no-ops.
682+
// Linker arrays are not supported on this platform. Make macros no-ops.
673683
#define UPB_LINKARR_APPEND(name)
674684
#define UPB_LINKARR_DECLARE(name, type) \
675685
UPB_STATIC_ASSERT(sizeof("__la_" #name) <= 17, \
@@ -19103,3 +19113,5 @@ const char* UPB_PRIVATE(_upb_WireReader_SkipGroup)(
1910319113
#undef _UPB_STRINGIFY
1910419114
#undef _UPB_STRINGIFY2
1910519115
#undef UPB_CONSTRUCTOR
19116+
#undef UPB_RETAIN
19117+
#undef UPB_HIDDEN

ruby/ext/google/protobuf_c/ruby-upb.h

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ Error, UINTPTR_MAX is undefined
494494

495495
/* aarch64 supports big and little endian modes; fasttable performs multibyte
496496
* tag loads assumes the tag of a varint is in the low bits. */
497-
#if (defined(__x86_64__) || defined(__AARCH64EL__)) && \
497+
#if !defined(_WIN32) && (defined(__x86_64__) || defined(__AARCH64EL__)) && \
498498
UPB_HAS_ATTRIBUTE(preserve_none) && UPB_HAS_ATTRIBUTE(musttail)
499499
#define UPB_FASTTABLE_SUPPORTED 1
500500
#else
@@ -513,7 +513,11 @@ Error, UINTPTR_MAX is undefined
513513
* This is useful for releasing code that might be used on multiple platforms,
514514
* for example the PHP or Ruby C extensions. */
515515
#elif defined(UPB_TRY_ENABLE_FASTTABLE)
516-
#define UPB_FASTTABLE UPB_FASTTABLE_SUPPORTED
516+
#if UPB_FASTTABLE_SUPPORTED
517+
#define UPB_FASTTABLE 1
518+
#else
519+
#define UPB_FASTTABLE 0
520+
#endif
517521
#else
518522
#define UPB_FASTTABLE 0
519523
#endif
@@ -567,6 +571,12 @@ Error, UINTPTR_MAX is undefined
567571
#define UPB_RETAIN
568572
#endif
569573

574+
#if defined(__GNUC__) || defined(__clang__)
575+
#define UPB_HIDDEN __attribute__((visibility("hidden")))
576+
#else
577+
#define UPB_HIDDEN
578+
#endif
579+
570580
// Linker arrays combine elements from multiple translation units into a single
571581
// array that can be iterated over at runtime.
572582
//
@@ -620,7 +630,7 @@ Error, UINTPTR_MAX is undefined
620630

621631
#elif defined(__MACH__)
622632

623-
/* As described in: https://stackoverflow.com/a/22366882 */
633+
/* As described in: https://stackoverflow.com/a/22366882 */
624634
#define UPB_LINKARR_APPEND(name) \
625635
__attribute__(( \
626636
section("__DATA,__la_" #name))) UPB_LINKARR_ATTR UPB_NO_SANITIZE_ADDRESS
@@ -639,10 +649,10 @@ Error, UINTPTR_MAX is undefined
639649

640650
#elif defined(_MSC_VER)
641651

642-
/* See:
643-
* https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
644-
* https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
645-
* https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
652+
/* See:
653+
* https://devblogs.microsoft.com/oldnewthing/20181107-00/?p=100155
654+
* https://devblogs.microsoft.com/oldnewthing/20181108-00/?p=100165
655+
* https://devblogs.microsoft.com/oldnewthing/20181109-00/?p=100175 */
646656
#define UPB_STRINGIFY_INTERNAL(x) #x
647657
#define UPB_STRINGIFY(x) UPB_STRINGIFY_INTERNAL(x)
648658
#define UPB_CONCAT(a, b, c) a##b##c
@@ -651,7 +661,7 @@ Error, UINTPTR_MAX is undefined
651661
#define UPB_LINKARR_APPEND(name) \
652662
__pragma(section(UPB_LINKARR_NAME(name, $j), read)) \
653663
__declspec(allocate(UPB_LINKARR_NAME(name, $j)))
654-
// clang-format off
664+
// clang-format off
655665
#define UPB_LINKARR_DECLARE(name, type) \
656666
__pragma(message(UPB_LINKARR_NAME(name, $j))) \
657667
__pragma(section(UPB_LINKARR_NAME(name, $a), read)) \
@@ -662,13 +672,13 @@ Error, UINTPTR_MAX is undefined
662672
type __stop_linkarr_##name; \
663673
UPB_LINKARR_APPEND(name) \
664674
__declspec(selectany) type UPB_linkarr_internal_empty_##name[1] = {0}
665-
// clang-format on
675+
// clang-format on
666676
#define UPB_LINKARR_START(name) (&__start_linkarr_##name)
667677
#define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)
668678

669679
#else
670680

671-
// Linker arrays are not supported on this platform. Make macros no-ops.
681+
// Linker arrays are not supported on this platform. Make macros no-ops.
672682
#define UPB_LINKARR_APPEND(name)
673683
#define UPB_LINKARR_DECLARE(name, type) \
674684
UPB_STATIC_ASSERT(sizeof("__la_" #name) <= 17, \
@@ -19436,3 +19446,5 @@ UPB_PRIVATE(upb_WireWriter_VarintUnusedSizeFromLeadingZeros64)(uint64_t clz) {
1943619446
#undef _UPB_STRINGIFY
1943719447
#undef _UPB_STRINGIFY2
1943819448
#undef UPB_CONSTRUCTOR
19449+
#undef UPB_RETAIN
19450+
#undef UPB_HIDDEN

src/file_lists.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,17 @@ set(libupb_srcs
752752
${protobuf_SOURCE_DIR}/upb/util/required_fields.c
753753
${protobuf_SOURCE_DIR}/upb/wire/byte_size.c
754754
${protobuf_SOURCE_DIR}/upb/wire/decode.c
755+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/cardinality.c
756+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/dispatch.c
757+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/field_extension.c
758+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/field_fixed.c
759+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/field_generic.c
760+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/field_message.c
761+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/field_mismatch.c
762+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/field_string.c
763+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/field_unknown.c
764+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/field_varint.c
765+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/function_array.c
755766
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/select.c
756767
${protobuf_SOURCE_DIR}/upb/wire/encode.c
757768
${protobuf_SOURCE_DIR}/upb/wire/encode_extension.c
@@ -883,6 +894,9 @@ set(libupb_hdrs
883894
${protobuf_SOURCE_DIR}/upb/wire/decode.h
884895
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/combinations.h
885896
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/data.h
897+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/dispatch.h
898+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/field_parsers.h
899+
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/function_array.h
886900
${protobuf_SOURCE_DIR}/upb/wire/decode_fast/select.h
887901
${protobuf_SOURCE_DIR}/upb/wire/encode.h
888902
${protobuf_SOURCE_DIR}/upb/wire/encode_extension.h

0 commit comments

Comments
 (0)