diff --git a/protobuf-c/protobuf-c.h b/protobuf-c/protobuf-c.h index 78b2443..349294a 100644 --- a/protobuf-c/protobuf-c.h +++ b/protobuf-c/protobuf-c.h @@ -53,8 +53,6 @@ # define PROTOBUF_C_DEPRECATED #endif -#define PROTOBUF_C_OFFSETOF(struct, member) offsetof(struct, member) - #if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB) # ifdef PROTOBUF_C_EXPORT # define PROTOBUF_C_API __declspec(dllexport) diff --git a/protoc-c/c_field.cc b/protoc-c/c_field.cc index f2afcea..1d5c440 100644 --- a/protoc-c/c_field.cc +++ b/protoc-c/c_field.cc @@ -145,16 +145,16 @@ void FieldGenerator::GenerateDescriptorInitializerGeneric(io::Printer* printer, break; case FieldDescriptor::LABEL_OPTIONAL: if (optional_uses_has) { - printer->Print(variables, " PROTOBUF_C_OFFSETOF($classname$, has_$name$),\n"); + printer->Print(variables, " offsetof($classname$, has_$name$),\n"); } else { printer->Print(variables, " 0, /* quantifier_offset */\n"); } break; case FieldDescriptor::LABEL_REPEATED: - printer->Print(variables, " PROTOBUF_C_OFFSETOF($classname$, n_$name$),\n"); + printer->Print(variables, " offsetof($classname$, n_$name$),\n"); break; } - printer->Print(variables, " PROTOBUF_C_OFFSETOF($classname$, $name$),\n"); + printer->Print(variables, " offsetof($classname$, $name$),\n"); printer->Print(variables, " $descriptor_addr$,\n"); printer->Print(variables, " $default_value$,\n"); printer->Print(variables, " $flags$, /* flags */\n");