[vlc-commits] contrib: srt: Correctly mark partial availability for functions

David Fuhrmann git at videolan.org
Thu Dec 20 02:11:12 CET 2018


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Thu Dec 20 02:00:34 2018 +0100| [170e6f8f2d99b2c91fe8b93644eb193e86a96bf5] | committer: David Fuhrmann

contrib: srt: Correctly mark partial availability for functions

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=170e6f8f2d99b2c91fe8b93644eb193e86a96bf5
---

 contrib/src/srt/fix-partial-availability.patch | 20 ++++++++++++++++++++
 contrib/src/srt/rules.mak                      |  9 +++------
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/contrib/src/srt/fix-partial-availability.patch b/contrib/src/srt/fix-partial-availability.patch
new file mode 100644
index 0000000000..6249090839
--- /dev/null
+++ b/contrib/src/srt/fix-partial-availability.patch
@@ -0,0 +1,20 @@
+--- srt/common/srt_compat.h_old	2018-12-20 02:07:53.000000000 +0100
++++ srt/common/srt_compat.h	2018-12-20 02:09:23.000000000 +0100
+@@ -82,7 +82,7 @@
+ {
+ #if defined(__SRT_OSX_CLOCK_GETTIME_AVAILABILITY) \
+    && (__SRT_OSX_CLOCK_GETTIME_AVAILABILITY == 1)
+-   if (&clock_gettime != NULL)
++   if (__builtin_available(macOS 10.12, iOS 10.0, tvOS 10.0, *))
+    {
+       return clock_gettime(clock_id, ts);
+    }
+@@ -95,7 +95,7 @@
+ {
+ #if defined(__SRT_OSX_CLOCK_GETTIME_AVAILABILITY) \
+    && (__SRT_OSX_CLOCK_GETTIME_AVAILABILITY == 1)
+-   if (&clock_getres != NULL)
++   if (__builtin_available(macOS 10.12, iOS 10.0, tvOS 10.0, *))
+    {
+       return clock_getres(clock_id, ts);
+    }
diff --git a/contrib/src/srt/rules.mak b/contrib/src/srt/rules.mak
index 68233c8f01..0f0e4bf362 100644
--- a/contrib/src/srt/rules.mak
+++ b/contrib/src/srt/rules.mak
@@ -11,10 +11,6 @@ ifeq ($(call need_pkg,"srt >= 1.2.2"),)
 PKGS_FOUND += srt
 endif
 
-ifdef HAVE_DARWIN_OS
-SRT_DARWIN=CFLAGS="$(CFLAGS) -Wno-error=partial-availability" CXXFLAGS="$(CXXFLAGS) -Wno-error=partial-availability"
-endif
-
 ifdef HAVE_WIN32
 DEPS_srt += pthreads $(DEPS_pthreads)
 endif
@@ -26,16 +22,17 @@ $(TARBALLS)/srt-$(SRT_VERSION).tar.gz:
 
 srt: srt-$(SRT_VERSION).tar.gz .sum-srt
 	$(UNPACK)
-	$(APPLY) $(SRC)/srt/add-implicit-link-libraries.patch 
+	$(APPLY) $(SRC)/srt/add-implicit-link-libraries.patch
 	$(APPLY) $(SRC)/srt/0001-CMakeLists.txt-substitute-link-flags-for-package-nam.patch
 	$(APPLY) $(SRC)/srt/0002-CMakeLists.txt-let-cmake-find-pthread.patch
+	$(APPLY) $(SRC)/srt/fix-partial-availability.patch
 	$(call pkg_static,"scripts/haisrt.pc.in")
 	mv srt-$(SRT_VERSION) $@ && touch $@
 
 DEPS_srt = gnutls $(DEPS_gnutls)
 
 .srt: srt toolchain.cmake
-	cd $< && $(HOSTVARS_PIC) $(SRT_DARWIN) $(CMAKE) \
+	cd $< && $(HOSTVARS_PIC) $(CMAKE) \
 		-DENABLE_SHARED=OFF -DUSE_GNUTLS=ON -DENABLE_CXX11=OFF
 	cd $< && $(MAKE) install
 	touch $@



More information about the vlc-commits mailing list