[vlc-commits] [Git][videolan/vlc][master] 6 commits: contrib: detect other Clang variants as Clang

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jul 4 13:34:28 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
40bc9abf by Steve Lhomme at 2026-07-04T15:03:39+02:00
contrib: detect other Clang variants as Clang

$(findstring) is case sensitive.

There are at least AppleClang, ARMClang, TIClang (from CMake).

Co-authored-by: Alexandre Janniaux <ajanni at videolabs.io>

- - - - -
0440225d by Steve Lhomme at 2026-07-04T15:03:40+02:00
contrib: live555: use the same time_tm construction as non Windows

Otherwise it fails to build with older compilers.

- - - - -
4ccb6f10 by Steve Lhomme at 2026-07-04T15:03:40+02:00
contrib: live555: remove forced C++20

It builds with older compilers as well with the default language version.

- - - - -
5956d6c8 by Steve Lhomme at 2026-07-04T15:03:40+02:00
contrib: live555: only patch the config file we will use

- - - - -
ed0f7f96 by Steve Lhomme at 2026-07-04T15:04:57+02:00
contrib: live555: fix build on older Windows

- - - - -
d3093319 by Steve Lhomme at 2026-07-04T15:05:14+02:00
contrib: live555: fix Clang minimum version for C++ 20

Apple clang 11 doesn't have support for -std=c++20

- - - - -


3 changed files:

- + contrib/src/live555/live555-vista-inet.patch
- contrib/src/live555/rules.mak
- contrib/src/main.mak


Changes:

=====================================
contrib/src/live555/live555-vista-inet.patch
=====================================
@@ -0,0 +1,33 @@
+--- live555/groupsock/NetAddress.cpp.orig	2026-06-25 00:45:17.000000000 +0200
++++ live555/groupsock/NetAddress.cpp	2026-07-03 15:07:01.647505300 +0200
+@@ -165,6 +165,30 @@ Boolean operator==(struct sockaddr_stora
+   }
+ }
+ 
++#if defined(_WIN32) && _WIN32_WINNT < 0x0600
++#ifndef AI_ADDRCONFIG
++# define AI_ADDRCONFIG   0x0400
++#endif
++static inline int inet_pton(int af, const char *src, u_int8_t *b)
++{
++  if (af != AF_INET) {
++    return 0;
++  }
++  return sscanf (src, "%hhu.%hhu.%hhu.%hhu",
++                 b + 0, b + 1, b + 2, b + 3) == 4;
++}
++
++static inline void inet_ntop(int af, const void *src, char *dst, int len)
++{
++  if (af != AF_INET) {
++    return;
++  }
++  const unsigned char *b = static_cast<const unsigned char *>(src);
++  _snprintf(dst, len, "%hhu.%hhu.%hhu.%hhu",
++            b[0], b[1], b[2], b[3]);
++}
++#endif
++
+ 
+ ////////// NetAddressList //////////
+ 


=====================================
contrib/src/live555/rules.mak
=====================================
@@ -12,7 +12,7 @@ endif
 else
 ifdef HAVE_CLANG
 # older CLANG doesn't support -std=c++20 required for std::atomic_flag
-ifeq ($(call clang_at_least, 10), true)
+ifeq ($(call clang_at_least, 12), true)
 HAVE_LIVE555_CPP20=1
 endif
 else
@@ -74,11 +74,11 @@ live555: $(LIVE555_FILE) .sum-live555
 	sed -e 's%C_COMPILER%#C_COMPILER%' -e 's%CPLUSPLUS_COMPILER%#CPLUSPLUS_COMPILER%' -e 's%LIBRARY_LINK%#LIBRARY_LINK%' -i.orig $(UNPACK_DIR)/config.$(LIVE_TARGET)
 	# Remove hardcoded --std=c+20 on un supported compilers
 ifndef HAVE_LIVE555_CPP20
-	sed -e 's%std=c++20%std=c++2a -DNO_STD_LIB=1%' -i.orig $(UNPACK_DIR)/config.$(LIVE_TARGET)
+	sed -e 's%-std=c++20% -DNO_STD_LIB=1%' -i.orig $(UNPACK_DIR)/config.$(LIVE_TARGET)
 endif
-	# Add the Extra_CFLAGS to all config files
+	# Add the Extra_CFLAGS to the config files
 	sed -i.orig \
-		-e 's%^\(COMPILE_OPTS.*\)$$%\1 '"$(LIVE_EXTRA_CFLAGS)%" $(UNPACK_DIR)/config.*
+		-e 's%^\(COMPILE_OPTS.*\)$$%\1 '"$(LIVE_EXTRA_CFLAGS)%" $(UNPACK_DIR)/config.$(LIVE_TARGET)
 	# We want 64bits offsets and PIC on Linux
 	sed -e 's%-D_FILE_OFFSET_BITS=64%-D_FILE_OFFSET_BITS=64\ -fPIC\ -DPIC%' -i.orig $(UNPACK_DIR)/config.linux
 	# Disable Locale for Solaris
@@ -97,6 +97,10 @@ endif
 	$(APPLY) $(SRC)/live555/android-no-ifaddrs.patch
 	# Don't use unavailable off64_t functions
 	$(APPLY) $(SRC)/live555/file-offset-bits-64.patch
+	# add IPv4 inet_pton()/inet_ntop() helper on older Windows
+	$(APPLY) $(SRC)/live555/live555-vista-inet.patch
+	# fix Win32 time_tm constructor to build on older compilers
+	sed -e 's,= tm{},= tm\(\),' -i.orig $(UNPACK_DIR)/liveMedia/RTSPCommon.cpp
 	# disable code built/installed in unused folder
 	sed -e 's,all: $$(,all: #,' -e 's,install: $$,install: #,' -e 's,install ,#install ,' -i.orig $(UNPACK_DIR)/testProgs/Makefile.tail
 	sed -e 's,all: $$(,all: #,' -e 's,install: $$,install: #,' -e 's,install ,#install ,' -i.orig $(UNPACK_DIR)/mediaServer/Makefile.tail


=====================================
contrib/src/main.mak
=====================================
@@ -155,7 +155,7 @@ clang_major_is = $(shell echo false)
 gcc_at_least = $(shell echo false)
 gcc_at_most  = $(shell echo false)
 gcc_major_is = $(shell echo false)
-ifneq ($(findstring clang, $(shell $(CC) --version 2>/dev/null)),)
+ifneq ($(findstring clang, $(shell $(CC) --version 2>/dev/null | grep -qi clang && echo "clang")),)
 HAVE_CLANG := 1
 CLANG_VERSION := $(shell $(CC) --version | head -1 | grep -o '[0-9]\+\.' | head -1 | cut -d '.' -f 1)
 clang_at_least = $(shell [ $(CLANG_VERSION) -ge $(1) ] && echo true)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c15d0d852d0045f1a9bf187f5a863a79f686144f...d3093319108aff155257b4f1062f94c2ff6d15b0

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c15d0d852d0045f1a9bf187f5a863a79f686144f...d3093319108aff155257b4f1062f94c2ff6d15b0
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list