[vlc-commits] [Git][videolan/vlc][master] 3 commits: compat: remove deprecated platform

Hugo Beauzée-Luyssen (@chouquette) gitlab at videolan.org
Thu Sep 16 18:05:45 UTC 2021



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC


Commits:
2d6897fd by Mehdi Sabwat at 2021-09-16T16:46:02+00:00
compat: remove deprecated platform

This commit removes conditional code for the Nacl platform.

- - - - -
18b04538 by Mehdi Sabwat at 2021-09-16T16:46:02+00:00
contrib: remove deprecated platform

This commit removes conditional code for the Nacl platform, in the contribs.

- - - - -
d6f44428 by Mehdi Sabwat at 2021-09-16T16:46:02+00:00
nacl: remove deprecated platform

This commit removes conditional code for the Nacl platform, in the core.

https://blog.chromium.org/2020/08/changes-to-chrome-app-support-timeline.html

- - - - -


21 changed files:

- compat/flockfile.c
- compat/getpid.c
- − compat/pathconf.c
- compat/recvmsg.c
- compat/sendmsg.c
- − compat/sigwait.c
- configure.ac
- contrib/bootstrap
- contrib/src/ass/rules.mak
- contrib/src/ffmpeg/rules.mak
- contrib/src/fontconfig/rules.mak
- contrib/src/gcrypt/rules.mak
- contrib/src/gmp/rules.mak
- contrib/src/gnutls/rules.mak
- contrib/src/gpg-error/rules.mak
- contrib/src/mpg123/rules.mak
- contrib/src/postproc/rules.mak
- include/vlc_fixups.h
- m4/dolt.m4
- src/Makefile.am
- src/network/getaddrinfo.c


Changes:

=====================================
compat/flockfile.c
=====================================
@@ -54,17 +54,6 @@ int putc_unlocked (int c, FILE *stream)
 {
     return _putc_nolock (c, stream);
 }
-
-#elif defined __native_client__
-void flockfile (FILE *stream)
-{
-    _flockfile(stream);
-}
-
-void funlockfile (FILE *stream)
-{
-    _funlockfile(stream);
-}
 #else
 # error flockfile not implemented on your platform!
 #endif


=====================================
compat/getpid.c
=====================================
@@ -31,8 +31,6 @@ pid_t getpid (void)
 {
 #if defined (_WIN32)
     return (pid_t) GetCurrentProcessId ();
-#elif defined (__native_client__)
-    return 1;
 #else
 # error Unimplemented!
 #endif


=====================================
compat/pathconf.c deleted
=====================================
@@ -1,40 +0,0 @@
-/*****************************************************************************
- * pathconf.c: POSIX pathconf() replacement
- *****************************************************************************
- * Copyright (C) 2017 VLC authors and VideoLAN
- *
- * Authors: Dennis Hamester <dhamester at jusst.de>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <vlc_common.h>
-
-#ifdef __native_client__
-long pathconf (const char *path, int name)
-{
-    VLC_UNUSED(path);
-    VLC_UNUSED(name);
-    return -1;
-}
-#elif defined(_WIN32)
-/* Windows does not have pathconf, but that is OK */
-#else
-# error pathconf not implemented on your platform!
-#endif


=====================================
compat/recvmsg.c
=====================================
@@ -83,85 +83,6 @@ ssize_t recvmsg(int fd, struct msghdr *msg, int flags)
     return -1;
 }
 
-#elif defined __native_client__
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
-#endif
-
-ssize_t recvmsg(int fd, struct msghdr *msg, int flags)
-{
-    if (msg->msg_controllen != 0)
-    {
-        errno = ENOSYS;
-        return -1;
-    }
-
-    if ((msg->msg_iovlen <= 0) || (msg->msg_iovlen > IOV_MAX))
-    {
-        errno = EMSGSIZE;
-        return -1;
-    }
-
-    size_t full_size = 0;
-    for (int i = 0; i < msg->msg_iovlen; ++i)
-        full_size += msg->msg_iov[i].iov_len;
-
-    if (full_size > SSIZE_MAX) {
-        errno = EINVAL;
-        return -1;
-    }
-
-    /**
-     * We always allocate here, because whether recv/recvfrom allow NULL message
-     * or not is unspecified.
-     */
-    char *data = malloc(full_size ? full_size : 1);
-    if (!data) {
-        errno = ENOMEM;
-        return -1;
-    }
-
-    ssize_t res;
-    if (msg->msg_name)
-        res = recvfrom(fd, data, full_size, flags, msg->msg_name, &msg->msg_namelen);
-    else
-        res = recv(fd, data, full_size, flags);
-
-    if (res > 0) {
-        size_t left;
-        if ((size_t)res <= full_size) {
-            left = res;
-            msg->msg_flags = 0;
-        }
-        else {
-            left = full_size;
-            msg->msg_flags = MSG_TRUNC;
-        }
-
-        const char *src = data;
-        for (int i = 0; (i < msg->msg_iovlen) && (left > 0); ++i)
-        {
-            size_t to_copy = msg->msg_iov[i].iov_len;
-            if (to_copy > left)
-                to_copy = left;
-
-            memcpy(msg->msg_iov[i].iov_base, src, to_copy);
-            src += to_copy;
-            left -= to_copy;
-        }
-    }
-
-    free(data);
-    return res;
-}
-
 #else
 #error recvmsg not implemented on your platform!
 #endif


=====================================
compat/sendmsg.c
=====================================
@@ -73,67 +73,6 @@ ssize_t sendmsg(int fd, const struct msghdr *msg, int flags)
     return -1;
 }
 
-#elif defined __native_client__
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
-#endif
-
-ssize_t sendmsg(int fd, const struct msghdr *msg, int flags)
-{
-    if (msg->msg_controllen != 0)
-    {
-        errno = ENOSYS;
-        return -1;
-    }
-
-    if ((msg->msg_iovlen <= 0) || (msg->msg_iovlen > IOV_MAX))
-    {
-        errno = EMSGSIZE;
-        return -1;
-    }
-
-    size_t full_size = 0;
-    for (int i = 0; i < msg->msg_iovlen; ++i)
-        full_size += msg->msg_iov[i].iov_len;
-
-    if (full_size > SSIZE_MAX) {
-        errno = EINVAL;
-        return -1;
-    }
-
-    /**
-     * We always allocate here, because whether send/sento allow NULL message or
-     * not is unspecified.
-     */
-    char *data = malloc(full_size ? full_size : 1);
-    if (!data) {
-        errno = ENOMEM;
-        return -1;
-    }
-
-    size_t tmp = 0;
-    for (int i = 0; i < msg->msg_iovlen; ++i) {
-        memcpy(data + tmp, msg->msg_iov[i].iov_base, msg->msg_iov[i].iov_len);
-        tmp += msg->msg_iov[i].iov_len;
-    }
-
-    ssize_t res;
-    if (msg->msg_name)
-        res = sendto(fd, data, full_size, flags, msg->msg_name, msg->msg_namelen);
-    else
-        res = send(fd, data, full_size, flags);
-
-    free(data);
-    return res;
-}
-
 #else
 #error sendmsg not implemented on your platform!
 #endif


=====================================
compat/sigwait.c deleted
=====================================
@@ -1,49 +0,0 @@
-/*****************************************************************************
- * sigwait.c: POSIX sigwait() replacement
- *****************************************************************************
- * Copyright © 2017 VLC authors and VideoLAN
- *
- * Author: Julian Scheel <julian at jusst.de>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef __native_client__
-/* NaCl has no working sigwait, but SIGPIPE, for which vlc uses sigwait
- * currently, is never generated in NaCl. So for SIGPIPE it's safe to instantly
- * return, for all others run into an assertion. */
-
-#include <assert.h>
-#include <signal.h>
-
-int sigwait(const sigset_t *set, int *sig)
-{
-    sigset_t s = *set;
-    if (sigemptyset(&s))
-        return 0;
-    assert(sigismember(&s, SIGPIPE));
-    sigdelset(&s, SIGPIPE);
-    assert(sigemptyset(&s));
-
-    *sig = SIGPIPE;
-    return 0;
-}
-#else
-# error sigwait not implemented on your platform!
-#endif


=====================================
configure.ac
=====================================
@@ -388,13 +388,6 @@ __attribute__((visibility("default"))) int foo() { return my_array[0]; }
     X86ASMFLAGS="-f aout"
     X86ASMDEFS="-DARCH_X86_32=1 -DARCH_X86_64=0 -DPREFIX"
     ;;
-  *nacl*)
-    SYS=nacl
-    AC_DEFINE([_XOPEN_SOURCE], [700], [POSIX and XPG 7th edition])
-    AC_LIBOBJ([sigwait])
-    AC_LIBOBJ([recvmsg])
-    AC_LIBOBJ([sendmsg])
-    ;;
   *emscripten*)
     SYS=emscripten
     # tdestroy() is a GNU extension
@@ -450,7 +443,6 @@ AM_CONDITIONAL([HAVE_IOS],     [test "${HAVE_IOS}" = "1"])
 AM_CONDITIONAL([HAVE_OSX],     [test "${HAVE_OSX}" = "1"])
 AM_CONDITIONAL([HAVE_TVOS],    [test "${HAVE_TVOS}" = "1"])
 
-AM_CONDITIONAL([HAVE_NACL],    [test "${SYS}" = "nacl"])
 AM_CONDITIONAL([HAVE_LIBANL],  [test "${HAVE_LIBANL}" = "1"])
 
 AM_CONDITIONAL([HAVE_WIN32],   [test "${SYS}" = "mingw32"])
@@ -722,7 +714,7 @@ need_libc=false
 
 dnl Check for usual libc functions
 AC_CHECK_FUNCS([accept4 dup3 fcntl flock fstatat fstatvfs fork getmntent_r getenv getpwuid_r isatty memalign mkostemp mmap open_memstream newlocale pipe2 posix_fadvise setlocale stricmp uselocale wordexp])
-AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lfind lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp pathconf])
+AC_REPLACE_FUNCS([aligned_alloc atof atoll dirfd fdopendir flockfile fsync getdelim getpid lfind lldiv memrchr nrand48 poll posix_memalign recvmsg rewind sendmsg setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strnstr strsep strtof strtok_r strtoll swab tdestroy tfind timegm timespec_get strverscmp])
 AC_REPLACE_FUNCS([gettimeofday])
 AC_CHECK_FUNC(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])


=====================================
contrib/bootstrap
=====================================
@@ -355,9 +355,6 @@ case "${OS}" in
 	*solaris*)
 		add_make_enabled "HAVE_SOLARIS"
 		;;
-	*nacl*)
-		add_make_enabled "HAVE_NACL"
-		;;
 	*emscripten*)
 	       add_make_enabled "HAVE_EMSCRIPTEN"
 	       ;;


=====================================
contrib/src/ass/rules.mak
=====================================
@@ -23,14 +23,8 @@ WITH_FONTCONFIG = 0
 WITH_HARFBUZZ = 1
 WITH_DWRITE = 1
 else
-ifdef HAVE_NACL
 WITH_FONTCONFIG = 1
 WITH_HARFBUZZ = 1
-WITH_ASS_ASM = 0
-else
-WITH_FONTCONFIG = 1
-WITH_HARFBUZZ = 1
-endif
 endif
 endif
 endif


=====================================
contrib/src/ffmpeg/rules.mak
=====================================
@@ -211,10 +211,6 @@ endif
 FFMPEGCONF += --target-os=sunos --enable-pic
 endif
 
-ifdef HAVE_NACL
-FFMPEGCONF+=--disable-inline-asm --disable-asm --target-os=linux
-endif
-
 ifdef HAVE_EMSCRIPTEN
 FFMPEGCONF+= --arch=wasm32 --target-os=emscripten
 endif


=====================================
contrib/src/fontconfig/rules.mak
=====================================
@@ -50,10 +50,6 @@ FONTCONFIG_ENV += LIBXML2_CFLAGS=`xml2-config --cflags`
 FONTCONFIG_ENV += LIBXML2_LIBS=`xml2-config --libs`
 endif
 
-ifdef HAVE_NACL
-FONTCONFIG_ENV += ac_cv_func_random=no
-endif
-
 DEPS_fontconfig = freetype2 $(DEPS_freetype2) libxml2 $(DEPS_libxml2)
 
 .fontconfig: fontconfig


=====================================
contrib/src/gcrypt/rules.mak
=====================================
@@ -72,12 +72,6 @@ ifeq ($(ARCH),aarch64)
 GCRYPT_CONF += --disable-arm-crypto-support
 endif
 endif
-ifdef HAVE_NACL
-GCRYPT_CONF += --disable-asm --disable-aesni-support ac_cv_func_syslog=no --disable-sse41-support
-GCRYPT_CONF += --disable-avx-support --disable-avx2-support --disable-padlock-support
-GCRYPT_CONF += --disable-amd64-as-feature-detection --disable-drng-support
-GCRYPT_CONF += --disable-pclmul-support
-endif
 
 .gcrypt: gcrypt
 	# Reconfiguring this requires a git repo to be available, to


=====================================
contrib/src/gmp/rules.mak
=====================================
@@ -13,11 +13,6 @@ ifeq ($(ARCH),mips64el)
 GMP_CONF += --disable-assembly
 endif
 endif
-ifdef HAVE_NACL
-ifeq ($(ARCH),x86_64)
-GMP_CONF += --disable-assembly
-endif
-endif
 
 ifdef HAVE_WIN32
 ifeq ($(ARCH),arm)


=====================================
contrib/src/gnutls/rules.mak
=====================================
@@ -75,10 +75,6 @@ ifeq ($(ARCH),aarch64)
 endif
 endif
 
-ifdef HAVE_NACL
-	GNUTLS_CONF += --disable-hardware-acceleration
-endif
-
 .gnutls: gnutls
 	cd $< && $(GNUTLS_ENV) ./configure $(GNUTLS_CONF)
 	cd $< && $(MAKE) -C gl install


=====================================
contrib/src/gpg-error/rules.mak
=====================================
@@ -34,15 +34,6 @@ else
 	cp $@/src/syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h $@/src/syscfg/lock-obj-pub.linux-android.h
 endif
 endif
-ifdef HAVE_NACL
-ifeq ($(ARCH),i386) # 32bits intel
-	cp $@/src/syscfg/lock-obj-pub.i686-pc-linux-gnu.h $@/src/syscfg/lock-obj-pub.nacl.h
-else
-ifeq ($(ARCH),x86_64)
-	cp $@/src/syscfg/lock-obj-pub.x86_64-pc-linux-gnu.h $@/src/syscfg/lock-obj-pub.nacl.h
-endif
-endif
-endif
 
 GPGERROR_CONF := $(HOSTCONF) \
 	--disable-nls \


=====================================
contrib/src/mpg123/rules.mak
=====================================
@@ -30,10 +30,6 @@ MPG123CONF += --with-cpu=generic_dither
 endif
 endif
 
-ifdef HAVE_NACL
-MPG123CONF += ac_cv_header_sys_select_h=no
-endif
-
 $(TARBALLS)/mpg123-$(MPG123_VERSION).tar.bz2:
 	$(call download_pkg,$(MPG123_URL),mpg123)
 


=====================================
contrib/src/postproc/rules.mak
=====================================
@@ -103,10 +103,6 @@ ifdef HAVE_SOLARIS
 POSTPROCCONF += --enable-pic
 endif
 
-ifdef HAVE_NACL
-POSTPROCCONF += --target-os=linux
-endif
-
 # Build
 
 ifdef GPL


=====================================
include/vlc_fixups.h
=====================================
@@ -33,7 +33,7 @@
 
 /* C++11 says there's no need to define __STDC_*_MACROS when including
  * inttypes.h and stdint.h. */
-#if defined (__cplusplus) && (defined(__MINGW32__) || defined(__UCLIBC__) || defined(__native_client__))
+#if defined (__cplusplus) && (defined(__MINGW32__) || defined(__UCLIBC__))
 # ifndef __STDC_FORMAT_MACROS
 #  define __STDC_FORMAT_MACROS 1
 # endif
@@ -121,15 +121,6 @@ extern "C" {
 # define VLC_NOTHROW
 #endif
 
-/* signal.h */
-#if !defined(HAVE_SIGWAIT) && defined(__native_client__)
-/* NaCl does not define sigwait in signal.h. We need to include it here to
- * define sigwait, because sigset_t is allowed to be either an integral or a
- * struct. */
-#include <signal.h>
-int sigwait(const sigset_t *set, int *sig);
-#endif
-
 /* stddef.h */
 #if !defined (__cplusplus) && !defined (HAVE_MAX_ALIGN_T)
 typedef struct {
@@ -269,10 +260,6 @@ pid_t getpid (void) VLC_NOTHROW;
 int fsync (int fd);
 #endif
 
-#ifndef HAVE_PATHCONF
-long pathconf (const char *path, int name);
-#endif
-
 /* dirent.h */
 #ifndef HAVE_DIRFD
 int (dirfd) (DIR *);
@@ -324,10 +311,6 @@ void *aligned_alloc(size_t, size_t);
 #define aligned_free(ptr)  free(ptr)
 #endif
 
-#if defined(__native_client__) && defined(__cplusplus)
-# define HAVE_USELOCALE
-#endif
-
 #if !defined(HAVE_NEWLOCALE) && defined(HAVE_CXX_LOCALE_T) && defined(__cplusplus)
 # include <locale>
 # define HAVE_NEWLOCALE
@@ -393,11 +376,6 @@ int inet_pton(int, const char *, void *);
 const char *inet_ntop(int, const void *, char *, socklen_t);
 #endif
 
-/* NaCl has a broken netinet/tcp.h, so TCP_NODELAY is not set */
-#if defined(__native_client__) && !defined( HAVE_NETINET_TCP_H )
-#  define TCP_NODELAY 1
-#endif
-
 #ifndef HAVE_STRUCT_POLLFD
 enum
 {


=====================================
m4/dolt.m4
=====================================
@@ -21,7 +21,7 @@ AS_IF([test x$GCC != xyes], [dolt_supported=no])
 AS_CASE([$host],
     [*-*-linux*|*-*-freebsd*], [pic_options='-fPIC'],
     [*-apple-darwin*],         [pic_options='-fno-common'],
-    [*mingw*|*nacl*],          [pic_options='']
+    [*mingw*],                 [pic_options='']
     [*],                       [dolt_supported=no]
 )
 AS_IF([test x$dolt_supported = xno], [


=====================================
src/Makefile.am
=====================================
@@ -433,17 +433,6 @@ libvlccore_la_SOURCES += \
 	os2/thread.c
 endif
 
-if HAVE_NACL
-libvlccore_la_SOURCES += \
-	android/error.c \
-	posix/dirs.c \
-	posix/filesystem.c \
-	posix/netconf.c \
-	posix/rand.c \
-	posix/specific.c \
-	posix/timer.c
-endif
-
 if HAVE_EMSCRIPTEN
 libvlccore_la_SOURCES += \
 	posix/thread.c \
@@ -490,7 +479,6 @@ endif
 
 if !HAVE_WIN32
 if !HAVE_OS2
-if !HAVE_NACL
 libvlccore_la_SOURCES += \
 	posix/filesystem.c \
 	posix/plugin.c \
@@ -525,7 +513,6 @@ endif
 endif
 endif
 endif
-endif
 
 if ENABLE_SOUT
 libvlccore_la_SOURCES += \


=====================================
src/network/getaddrinfo.c
=====================================
@@ -120,8 +120,7 @@ int vlc_getaddrinfo (const char *node, unsigned port,
 }
 
 #if defined (_WIN32) || defined (__OS2__) \
- || defined (__ANDROID__) || defined (__APPLE__) \
- || defined (__native_client__)
+ || defined (__ANDROID__) || defined (__APPLE__)
 #warning vlc_getaddrinfo_i11e() not implemented!
 int vlc_getaddrinfo_i11e(const char *node, unsigned port,
                          const struct addrinfo *hints, struct addrinfo **res)



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ccfa4ed95c606f480ce45e128696edfe1338edd7...d6f4442879bb5a76f9d47c803f6e146f518ae20c

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ccfa4ed95c606f480ce45e128696edfe1338edd7...d6f4442879bb5a76f9d47c803f6e146f518ae20c
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list