Skip to content

Instantly share code, notes, and snippets.

@bstriner
Created August 16, 2018 03:25
Show Gist options
  • Save bstriner/1d4ee0db5e5efcc04c6a82b20ee0bebb to your computer and use it in GitHub Desktop.
Save bstriner/1d4ee0db5e5efcc04c6a82b20ee0bebb to your computer and use it in GitHub Desktop.
TensorFlow patch for protobuf
diff --git a/src/google/protobuf/generated_message_reflection.h b/src/google/protobuf/generated_message_reflection.h
index 177312cf..9a2e8e26 100644
--- a/src/google/protobuf/generated_message_reflection.h
+++ b/src/google/protobuf/generated_message_reflection.h
@@ -58,6 +58,8 @@
#error "You cannot SWIG proto headers"
#endif
+#undef GetMessage
+
namespace upb {
namespace google_opensource {
class GMR_Handlers;
diff --git a/src/google/protobuf/message.h b/src/google/protobuf/message.h
index 007dafa2..2bbe7456 100644
--- a/src/google/protobuf/message.h
+++ b/src/google/protobuf/message.h
@@ -132,6 +132,8 @@
#error "You cannot SWIG proto headers"
#endif
+#undef GetMessage
+
namespace google {
namespace protobuf {
@bstriner
Copy link
Author

bstriner commented Aug 16, 2018

Save file to tensorflow folder and add patch_file="//tensorflow:[filename.txt]" to protobuf libraries in workspace.bzl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment