aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc
diff options
context:
space:
mode:
authorGravatar Shanqing Cai <cais@google.com>2016-09-11 10:03:45 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-09-11 11:17:31 -0700
commit645a554a41ef5524e7ec65beeb7976c066886da6 (patch)
treead90a0ec2b833e20941db4aad3c7a5f24b4df0ff /tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc
parentd49688f9c2f2acf33a408a1e010f4cc6623b93d0 (diff)
Update OSS protobuf git depedency version to 3.0.2
3.0.2 is the latest release. Add a level of indirection to the int64 type in 1) core/example/feature_util.h, feature_util.cc and the places where the type is used 2) tools/proto_text/gen_proto_text_functions_lib.cc and its tests. This is for dealing with the variability of "int64" type definition among different platforms. On some systems, int64 is "long int", while on others it is "long long int". See GitHub Issue for more details: https://github.com/tensorflow/tensorflow/issues/3626. This change list fixes the issue and eliminates the need to stick to an old (3.0.0-beta-2) commit of protobuf. Change: 132814372
Diffstat (limited to 'tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc')
-rw-r--r--tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc b/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc
index a5b0f03a25..c31f3c4e81 100644
--- a/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc
+++ b/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc
@@ -224,9 +224,18 @@ string GetProtoHeaderName(const FileDescriptor& fd) {
// Returns the C++ class name for the given proto field.
string GetCppClass(const FieldDescriptor& d) {
- return d.cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE
- ? GetQualifiedName(*d.message_type())
- : d.cpp_type_name();
+ string cpp_class = d.cpp_type() == FieldDescriptor::CPPTYPE_MESSAGE
+ ? GetQualifiedName(*d.message_type())
+ : d.cpp_type_name();
+
+ // In open-source TensorFlow, the definition of int64 varies across
+ // platforms. The following line, which is manipulated during internal-
+ // external sync'ing, takes care of the variability.
+ if (cpp_class == "int64") {
+ cpp_class = kProtobufInt64Typename;
+ }
+
+ return cpp_class;
}
// Returns the string that can be used for a header guard for the generated