From ec53b8cb600e818c3fffea2c8f3d20eaaa2fc743 Mon Sep 17 00:00:00 2001 From: Florian Enner Date: Sat, 31 Jan 2015 18:42:12 -0500 Subject: [PATCH 1/4] added missing ruby generator to msvc project https://github.com/google/protobuf/issues/87 --- vsprojects/libprotoc.vcproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vsprojects/libprotoc.vcproj b/vsprojects/libprotoc.vcproj index 45a5936f83..6b1e886445 100644 --- a/vsprojects/libprotoc.vcproj +++ b/vsprojects/libprotoc.vcproj @@ -223,6 +223,10 @@ RelativePath="..\src\google\protobuf\compiler\cpp\cpp_string_field.h" > + + @@ -375,6 +379,10 @@ RelativePath="..\src\google\protobuf\compiler\cpp\cpp_string_field.cc" > + + From df4730ca9c093a8551b2a9ee7ba0f3098796aeb8 Mon Sep 17 00:00:00 2001 From: Florian Enner Date: Sat, 31 Jan 2015 19:01:34 -0500 Subject: [PATCH 2/4] fixed MSVC compile error is not part of the standard, so I've added a workaround. --- src/google/protobuf/compiler/ruby/ruby_generator.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/google/protobuf/compiler/ruby/ruby_generator.cc b/src/google/protobuf/compiler/ruby/ruby_generator.cc index c568790393..bb88fc16e0 100644 --- a/src/google/protobuf/compiler/ruby/ruby_generator.cc +++ b/src/google/protobuf/compiler/ruby/ruby_generator.cc @@ -46,6 +46,12 @@ namespace protobuf { namespace compiler { namespace ruby { +#if _MSC_VER >= 1400 // VS 2005 and above + // is not part of the standard, so we need to map + // to MSVC's custom sized integer types instead. + typedef unsigned __int32 uint32_t; +#endif + // Forward decls. std::string IntToString(uint32_t value); std::string StripDotProto(const std::string& proto_file); From e1e86b02a8569f522a867d55c42e5ac5664fc86e Mon Sep 17 00:00:00 2001 From: Florian Enner Date: Sat, 31 Jan 2015 19:22:52 -0500 Subject: [PATCH 3/4] replaced type fix with the recommended way --- src/google/protobuf/compiler/ruby/ruby_generator.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/google/protobuf/compiler/ruby/ruby_generator.cc b/src/google/protobuf/compiler/ruby/ruby_generator.cc index bb88fc16e0..da2e7e8960 100644 --- a/src/google/protobuf/compiler/ruby/ruby_generator.cc +++ b/src/google/protobuf/compiler/ruby/ruby_generator.cc @@ -45,15 +45,9 @@ namespace google { namespace protobuf { namespace compiler { namespace ruby { - -#if _MSC_VER >= 1400 // VS 2005 and above - // is not part of the standard, so we need to map - // to MSVC's custom sized integer types instead. - typedef unsigned __int32 uint32_t; -#endif // Forward decls. -std::string IntToString(uint32_t value); +std::string IntToString(uint32 value); std::string StripDotProto(const std::string& proto_file); std::string LabelForField(google::protobuf::FieldDescriptor* field); std::string TypeName(google::protobuf::FieldDescriptor* field); @@ -70,7 +64,7 @@ void GenerateEnumAssignment( const google::protobuf::EnumDescriptor* en, google::protobuf::io::Printer* printer); -std::string IntToString(uint32_t value) { +std::string IntToString(uint32 value) { std::ostringstream os; os << value; return os.str(); From e544b38815134ea800c1c4d86d207c1b56535afe Mon Sep 17 00:00:00 2001 From: Florian Enner Date: Mon, 2 Feb 2015 15:19:01 -0500 Subject: [PATCH 4/4] removed accidental whitespace --- src/google/protobuf/compiler/ruby/ruby_generator.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/compiler/ruby/ruby_generator.cc b/src/google/protobuf/compiler/ruby/ruby_generator.cc index da2e7e8960..22a64de91c 100644 --- a/src/google/protobuf/compiler/ruby/ruby_generator.cc +++ b/src/google/protobuf/compiler/ruby/ruby_generator.cc @@ -45,7 +45,7 @@ namespace google { namespace protobuf { namespace compiler { namespace ruby { - + // Forward decls. std::string IntToString(uint32 value); std::string StripDotProto(const std::string& proto_file);