[vlc-commits] [Git][videolan/vlc][master] contrib: protobuf: Apply a patch to avoid relying on transitive includes

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Feb 19 10:35:18 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
5f677641 by Martin Storsjö at 2022-02-19T09:40:05+00:00
contrib: protobuf: Apply a patch to avoid relying on transitive includes

This fixes build breakage with latest nightly libc++. Since
https://github.com/llvm/llvm-project/commit/2e2f3158c604adb8401a2a44a03f58d4b6f1c7f9,
fewer libc++ headers transitively include <algorithm>.

This protobuf header uses std::fill unconditionally, which is a
function provided by <algorithm>. (The surrounding code comment was
wrong/outdated - <algorithm> was needed on all platforms.)

The same seems to have been fixed in upstream protobuf as part
of a larger code sync:
https://github.com/protocolbuffers/protobuf/commit/ab4585a6956675ce14a1cba5d321fde980bbf12b#diff-5cc9e8e347380b7bbc8fac8c06dc98100f3b5c076fcffa177e8ce11e753d4f7c

- - - - -


2 changed files:

- + contrib/src/protobuf/include-algorithm.patch
- contrib/src/protobuf/rules.mak


Changes:

=====================================
contrib/src/protobuf/include-algorithm.patch
=====================================
@@ -0,0 +1,14 @@
+--- protobuf/src/google/protobuf/repeated_field.h.orig	2022-02-17 12:44:54.526527423 +0200
++++ protobuf/src/google/protobuf/repeated_field.h	2022-02-17 12:44:58.190446363 +0200
+@@ -46,11 +46,7 @@
+ #ifndef GOOGLE_PROTOBUF_REPEATED_FIELD_H__
+ #define GOOGLE_PROTOBUF_REPEATED_FIELD_H__
+ 
+-#ifdef _MSC_VER
+-// This is required for min/max on VS2013 only.
+ #include <algorithm>
+-#endif
+-
+ #include <string>
+ #include <iterator>
+ #include <google/protobuf/stubs/casts.h>


=====================================
contrib/src/protobuf/rules.mak
=====================================
@@ -41,6 +41,7 @@ protoc: protoc-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protoc
 	tar xvzfo "$<" -C $(UNPACK_DIR) --strip-components=1
 	$(APPLY) $(SRC)/protobuf/protobuf-disable-gmock.patch
 	$(APPLY) $(SRC)/protobuf/protobuf-fix-build.patch
+	$(APPLY) $(SRC)/protobuf/include-algorithm.patch
 	$(MOVE)
 
 .protoc: protoc
@@ -55,6 +56,7 @@ protobuf: protobuf-$(PROTOBUF_VERSION)-cpp.tar.gz .sum-protobuf
 	$(APPLY) $(SRC)/protobuf/protobuf-disable-gmock.patch
 	$(APPLY) $(SRC)/protobuf/dont-build-protoc.patch
 	$(APPLY) $(SRC)/protobuf/protobuf-fix-build.patch
+	$(APPLY) $(SRC)/protobuf/include-algorithm.patch
 	$(MOVE)
 
 .protobuf: protobuf



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5f6776416e903200941db906e16efea56454ed25

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/5f6776416e903200941db906e16efea56454ed25
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list