A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/protocolbuffers/protobuf/commit/a639cf8548d4c1596575005d84cc13bb8705b1d9 below:

[ObjC] Raise the library version and enable new generated code. · protocolbuffers/protobuf@a639cf8 · GitHub

File tree Expand file treeCollapse file tree 8 files changed

+22

-45

lines changed

Filter options

Expand file treeCollapse file tree 8 files changed

+22

-45

lines changed Original file line number Diff line number Diff line change

@@ -114,7 +114,7 @@

114 114

// Current library runtime version.

115 115

// - Gets bumped when the runtime makes changes to the interfaces between the

116 116

// generated code and runtime (things added/removed, etc).

117 -

#define GOOGLE_PROTOBUF_OBJC_VERSION 30007

117 +

#define GOOGLE_PROTOBUF_OBJC_VERSION 40310

118 118 119 119

// Minimum runtime version supported for compiling/running against.

120 120

// - Gets changed when support for the older generated code is dropped.

Original file line number Diff line number Diff line change

@@ -6,6 +6,7 @@

6 6

// https://developers.google.com/open-source/licenses/bsd

7 7 8 8

#import "GPBMessage.h"

9 +

#import "GPBBootstrap.h"

9 10

#import "GPBMessage_PackagePrivate.h"

10 11 11 12

#import <Foundation/Foundation.h>

@@ -1113,19 +1114,17 @@ + (instancetype)alloc {

1113 1114

+ (GPBDescriptor *)descriptor {

1114 1115

// This is thread safe because it is called from +initialize.

1115 1116

static GPBDescriptor *descriptor = NULL;

1116 -

static GPBFileDescription fileDescription = {

1117 -

.package = "internal", .prefix = "", .syntax = GPBFileSyntaxProto2};

1117 +

static GPBFilePackageAndPrefix fileDescription = {.package = "internal", .prefix = ""};

1118 1118

if (!descriptor) {

1119 -

descriptor = [GPBDescriptor

1120 -

allocDescriptorForClass:[GPBMessage class]

1121 -

messageName:@"GPBMessage"

1122 -

fileDescription:&fileDescription

1123 -

fields:NULL

1124 -

fieldCount:0

1125 -

storageSize:0

1126 -

flags:(GPBDescriptorInitializationFlag_UsesClassRefs |

1127 -

GPBDescriptorInitializationFlag_Proto3OptionalKnown |

1128 -

GPBDescriptorInitializationFlag_ClosedEnumSupportKnown)];

1119 +

descriptor =

1120 +

[GPBDescriptor allocDescriptorForClass:[GPBMessage class]

1121 +

messageName:@"GPBMessage"

1122 +

runtimeSupport:&GOOGLE_PROTOBUF_OBJC_EXPECTED_GENCODE_VERSION_40310

1123 +

fileDescription:&fileDescription

1124 +

fields:NULL

1125 +

fieldCount:0

1126 +

storageSize:0

1127 +

flags:GPBDescriptorInitializationFlag_None];

1129 1128

}

1130 1129

return descriptor;

1131 1130

}

Original file line number Diff line number Diff line change

@@ -233,7 +233,6 @@ void EnumGenerator::GenerateSource(io::Printer* printer) const {

233 233

GPBEnumDescriptor *$name$_EnumDescriptor(void) {

234 234

static _Atomic(GPBEnumDescriptor*) descriptor = nil;

235 235

if (!descriptor) {

236 -

GPB_DEBUG_CHECK_RUNTIME_VERSIONS();

237 236

static const char *valueNames =

238 237

$values_name_blob$

239 238

static const int32_t values[] = {

@@ -242,6 +241,7 @@ void EnumGenerator::GenerateSource(io::Printer* printer) const {

242 241

$maybe_extra_text_format_decl$

243 242

GPBEnumDescriptor *worker =

244 243

[GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol($name$)

244 +

runtimeSupport:&$google_protobuf_runtime_support$

245 245

valueNames:valueNames

246 246

values:values

247 247

count:(uint32_t)(sizeof(values) / sizeof(int32_t))

Original file line number Diff line number Diff line change

@@ -73,9 +73,6 @@ void ExtensionGenerator::GenerateStaticVariablesInitialization(

73 73

std::vector<std::string> options;

74 74

if (descriptor_->is_repeated()) options.push_back("GPBExtensionRepeated");

75 75

if (descriptor_->is_packed()) options.push_back("GPBExtensionPacked");

76 -

if (descriptor_->containing_type()->options().message_set_wire_format()) {

77 -

options.push_back("GPBExtensionSetWireFormat");

78 -

}

79 76 80 77

printer->Emit(

81 78

{{"default",

Original file line number Diff line number Diff line change

@@ -86,12 +86,6 @@ void SetCommonFieldVariables(const FieldDescriptor* descriptor,

86 86

if (descriptor->has_default_value())

87 87

field_flags.push_back("GPBFieldHasDefaultValue");

88 88

if (needs_custom_name) field_flags.push_back("GPBFieldTextFormatNameCustom");

89 -

if (descriptor->type() == FieldDescriptor::TYPE_ENUM) {

90 -

field_flags.push_back("GPBFieldHasEnumDescriptor");

91 -

if (descriptor->enum_type()->is_closed()) {

92 -

field_flags.push_back("GPBFieldClosedEnum");

93 -

}

94 -

}

95 89

// It will clear on a zero value if...

96 90

// - not repeated/map

97 91

// - doesn't have presence

Original file line number Diff line number Diff line change

@@ -43,7 +43,7 @@ namespace objectivec {

43 43

namespace {

44 44 45 45

// This is also found in GPBBootstrap.h, and needs to be kept in sync.

46 -

const int32_t GOOGLE_PROTOBUF_OBJC_VERSION = 30007;

46 +

const int32_t GOOGLE_PROTOBUF_OBJC_VERSION = 40310;

47 47 48 48

const char* kHeaderExtension = ".pbobjc.h";

49 49

@@ -607,6 +607,9 @@ void FileGenerator::GenerateFile(io::Printer* p, GeneratedFileType file_type,

607 607

// then honor the directives within the generators sources.

608 608

"clangfmt", "clang-format"},

609 609

{"root_class_name", root_class_name_},

610 +

{"google_protobuf_runtime_support",

611 +

absl::StrCat("GOOGLE_PROTOBUF_OBJC_EXPECTED_GENCODE_VERSION_",

612 +

GOOGLE_PROTOBUF_OBJC_VERSION)},

610 613

});

611 614 612 615

p->Emit(

@@ -740,7 +743,7 @@ void FileGenerator::EmitRootExtensionRegistryImplementation(

740 743

for (size_t i = 0; i < sizeof(descriptions) / sizeof(descriptions[0]); ++i) {

741 744

GPBExtensionDescriptor *extension =

742 745

[[GPBExtensionDescriptor alloc] initWithExtensionDescription:&descriptions[i]

743 -

usesClassRefs:YES];

746 +

runtimeSupport:&$google_protobuf_runtime_support$];

744 747

[registry addExtension:extension];

745 748

[self globallyRegisterExtension:extension];

746 749

[extension release];

@@ -773,7 +776,6 @@ void FileGenerator::EmitRootExtensionRegistryImplementation(

773 776

// about thread safety and initialization of registry.

774 777

static GPBExtensionRegistry* registry = nil;

775 778

if (!registry) {

776 -

GPB_DEBUG_CHECK_RUNTIME_VERSIONS();

777 779

registry = [[GPBExtensionRegistry alloc] init];

778 780

$register_local_extensions$;

779 781

$register_imports$

@@ -819,13 +821,11 @@ void FileGenerator::EmitFileDescription(io::Printer* p) const {

819 821

{"prefix_value",

820 822

objc_prefix.empty() && !file_->options().has_objc_class_prefix()

821 823

? "NULL"

822 -

: absl::StrCat("\"", objc_prefix, "\"")},

823 -

{"syntax", syntax}},

824 +

: absl::StrCat("\"", objc_prefix, "\"")}},

824 825

R"objc(

825 -

static GPBFileDescription $file_description_name$ = {

826 +

static GPBFilePackageAndPrefix $file_description_name$ = {

826 827

.package = $package_value$,

827 -

.prefix = $prefix_value$,

828 -

.syntax = $syntax$

828 +

.prefix = $prefix_value$

829 829

};

830 830

)objc");

831 831

p->Emit("\n");

Original file line number Diff line number Diff line change

@@ -60,12 +60,6 @@ MapFieldGenerator::MapFieldGenerator(

60 60

if (absl::StrContains(value_field_flags, "GPBFieldHasDefaultValue")) {

61 61

field_flags.push_back("GPBFieldHasDefaultValue");

62 62

}

63 -

if (absl::StrContains(value_field_flags, "GPBFieldHasEnumDescriptor")) {

64 -

field_flags.push_back("GPBFieldHasEnumDescriptor");

65 -

if (absl::StrContains(value_field_flags, "GPBFieldClosedEnum")) {

66 -

field_flags.push_back("GPBFieldClosedEnum");

67 -

}

68 -

}

69 63 70 64

variables_.Set("fieldflags", BuildFlagsString(FLAGTYPE_FIELD, field_flags));

71 65 Original file line number Diff line number Diff line change

@@ -429,10 +429,6 @@ void MessageGenerator::GenerateSource(io::Printer* printer) const {

429 429

: "GPBMessageFieldDescription");

430 430 431 431

std::vector<std::string> init_flags;

432 -

init_flags.push_back("GPBDescriptorInitializationFlag_UsesClassRefs");

433 -

init_flags.push_back("GPBDescriptorInitializationFlag_Proto3OptionalKnown");

434 -

init_flags.push_back(

435 -

"GPBDescriptorInitializationFlag_ClosedEnumSupportKnown");

436 432

if (need_defaults) {

437 433

init_flags.push_back("GPBDescriptorInitializationFlag_FieldsWithDefault");

438 434

}

@@ -488,10 +484,6 @@ void MessageGenerator::GenerateSource(io::Printer* printer) const {

488 484

// Start up the root class to support the scoped extensions.

489 485

__unused Class rootStartup = [$root_class_name$ class];

490 486

)objc");

491 -

} else {

492 -

// The Root class has a debug runtime check, so if not

493 -

// starting that up, add the check.

494 -

printer->Emit("GPB_DEBUG_CHECK_RUNTIME_VERSIONS();\n");

495 487

}

496 488

}},

497 489

{"field_description_type", field_description_type},

@@ -627,6 +619,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) const {

627 619

GPBDescriptor *localDescriptor =

628 620

[GPBDescriptor allocDescriptorForClass:$class_reference$

629 621

messageName:@"$message_name$"

622 +

runtimeSupport:&$google_protobuf_runtime_support$

630 623

fileDescription:&$file_description_name$

631 624

fields:$fields$

632 625

fieldCount:$fields_count$

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4