OK, based on sephacryl's message I created this patch, but I suspect edan's
problem is actually different. Can you both try it out and tell me if it
works? edan, if this doesn't solve the problem for you, can you try making
some changes yourself and figure out what works?
Index: src/google/protobuf/descriptor.cc
===================================================================
--- src/google/protobuf/descriptor.cc (revision 65)
+++ src/google/protobuf/descriptor.cc (working copy)
@@ -1693,6 +1693,9 @@
template<class DescriptorT> void AllocateOptions(
const typename DescriptorT::OptionsType& orig_options,
DescriptorT* descriptor);
+ // Specialization for FileOptions.
+ void AllocateOptions(const FileOptions& orig_options,
+ FileDescriptor* descriptor);
// Implementation for AllocateOptions(). Don't call this directly.
template<class DescriptorT> void AllocateOptionsImpl(
@@ -2208,9 +2211,8 @@
}
// We specialize for FileDescriptor.
-template<> void DescriptorBuilder::AllocateOptions<FileDescriptor>(
- const FileDescriptor::OptionsType& orig_options,
- FileDescriptor* descriptor) {
+void DescriptorBuilder::AllocateOptions(const FileOptions& orig_options,
+ FileDescriptor* descriptor) {
// We add the dummy token so that LookupSymbol does the right thing.
AllocateOptionsImpl(descriptor->package() + ".dummy", descriptor->name(),
orig_options, descriptor);
On Tue, Oct 7, 2008 at 10:05 PM, <[EMAIL PROTECTED]> wrote:
>
> What works is adding to the definition of class DescriptorBuilder to
> line1696,
>
> void AllocateOptions(
> const typename FileDescriptor::OptionsType& orig_options,
> FileDescriptor* descriptor);
>
> And changing the implementation, removing the template specialization,
> at line 2213 to:
>
> void DescriptorBuilder::AllocateOptions(
> const FileDescriptor::OptionsType& orig_options,
> FileDescriptor* descriptor) {
> // We add the dummy token so that LookupSymbol does the right thing.
> AllocateOptionsImpl(descriptor->package() + ".dummy", descriptor-
> >name(),
> orig_options, descriptor);
> }
>
> This is not incorrect either since it implements function overloading,
> without the messy template specialization.
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Protocol Buffers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---