[vlc-devel] [PATCH 15/19] contrib: protobuf: fix building with gcc on mingw32

Steve Lhomme robux4 at videolabs.io
Wed Jun 14 14:02:04 CEST 2017


the macros in this file just don't work
---
 contrib/src/protobuf/gcc-debug.patch | 16 ++++++++++++++++
 contrib/src/protobuf/rules.mak       |  1 +
 2 files changed, 17 insertions(+)
 create mode 100644 contrib/src/protobuf/gcc-debug.patch

diff --git a/contrib/src/protobuf/gcc-debug.patch b/contrib/src/protobuf/gcc-debug.patch
new file mode 100644
index 0000000000..cdd85dcd09
--- /dev/null
+++ b/contrib/src/protobuf/gcc-debug.patch
@@ -0,0 +1,16 @@
+--- protobuf/src/google/protobuf/extension_set.cc	2017-06-13 15:12:19.316388200 +0200
++++ protobuf/src/google/protobuf/extension_set.cc.debug	2017-06-13 15:11:22.492948400 +0200
+@@ -255,9 +255,13 @@ enum Cardinality {
+ 
+ }  // namespace
+ 
++#ifdef NDEBUG
++#define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE)
++#else
+ #define GOOGLE_DCHECK_TYPE(EXTENSION, LABEL, CPPTYPE)                             \
+   GOOGLE_DCHECK_EQ((EXTENSION).is_repeated ? REPEATED : OPTIONAL, LABEL);         \
+   GOOGLE_DCHECK_EQ(cpp_type((EXTENSION).type), WireFormatLite::CPPTYPE_##CPPTYPE)
++#endif
+ 
+ // -------------------------------------------------------------------
+ // Primitives
diff --git a/contrib/src/protobuf/rules.mak b/contrib/src/protobuf/rules.mak
index 5c15157e33..90c16566b7 100644
--- a/contrib/src/protobuf/rules.mak
+++ b/contrib/src/protobuf/rules.mak
@@ -22,6 +22,7 @@ protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protobuf
 	$(UNPACK)
 	mv protobuf-3.1.0 protobuf-3.1.0-cpp
 	$(APPLY) $(SRC)/protobuf/dont-build-protoc.patch
+	$(APPLY) $(SRC)/protobuf/gcc-debug.patch
 ifdef HAVE_WIN32
 	$(APPLY) $(SRC)/protobuf/win32-defines.patch
 endif
-- 
2.12.1



More information about the vlc-devel mailing list