소스 검색

fixed MSVC compile error

<stdint.h> is not part of the standard, so I've added a workaround.
Florian Enner 11 년 전
부모
커밋
df4730ca9c
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      src/google/protobuf/compiler/ruby/ruby_generator.cc

+ 6 - 0
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
+  // <stdint.h> 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);