1
mirror of https://code.videolan.org/videolan/vlc synced 2024-07-25 09:41:30 +02:00
Commit Graph

153 Commits

Author SHA1 Message Date
Steve Lhomme
e12783288c compat: update tdelete/tfind/tsearch/twalk from NetBSD sources
See functions in https://github.com/NetBSD/src/tree/trunk/lib/libc/stdlib

Fixes a leak in tdelete().
2022-07-12 21:01:17 +00:00
Rémi Denis-Courmont
a29ba2f99a compat: add writev() replacement 2022-07-03 17:31:24 +00:00
Rémi Denis-Courmont
488162f210 compat: add readv() replacement 2022-07-03 17:31:24 +00:00
Steve Lhomme
4e6f2c60a3 inet_pton: don't redefine EAFNOSUPPORT for Win32
It's officially supported by the Windows SDK. Callers of these POSIX API's
don't expect to check errno is WSAEAFNOSUPPORT.
2022-06-30 12:58:50 +00:00
Steve Lhomme
ddcc2cdcff compat: add missing errno on Winsock errors
Some of the error codes [1] correspond to errno values [2]

[1] https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2
[2] https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-constants
2022-06-28 17:24:51 +00:00
Rémi Denis-Courmont
ea93bcb8d3 compat: Linux getauxval() replacement
This was added over a decade ago, but 🤷...
2022-02-23 21:10:16 +00:00
Mehdi Sabwat
2d6897fd01 compat: remove deprecated platform
This commit removes conditional code for the Nacl platform.
2021-09-16 16:46:02 +00:00
Mehdi Sabwat
3f3296b03f compat: make clock_nanosleep usable by other OSes
This is to allow clock_nanosleep to be used by emscripten
and potentially other platforms.

The file should not be compiled on windows platforms, as it won't
find sys/errno.h

mach/clock_types.h is needed for clock_id_t, and is only available on
macos.
2021-09-05 14:58:30 +00:00
Mehdi Sabwat
d4b029ee5f compat: remove NSEC_PER_SEC in clock_nanosleep
This is to allow clock_nanosleep code to be used on platforms other
than Macosx.
2021-09-05 14:58:30 +00:00
Hugo Beauzée-Luyssen
86cb8efc29 compat: tfind: Don't use K&R prototypes
Some compilers are now refusing that syntax
2020-12-04 10:21:25 +01:00
Lyndon Brown
77431823c3 compat: gitignore test binaries
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
2020-10-06 14:21:51 +02:00
Alexandre Janniaux
e1c1eac150 compat: tfind: fix prototype
Use prototype from tsearch(3), fixes the following warning when
targetin Android arm API 17.

../../src/misc/variables.c:154:32: warning: passing 'void **' to
parameter of type 'const void **' discards qualifiers in nested
pointer types [-Wincompatible-pointer-types-discards-qualifiers]

    pp_var = tfind( &psz_name, &priv->var_root, varcmp );
                               ^~~~~~~~~~~~~~~
2020-06-30 10:49:18 +02:00
Marvin Scholz
be62319887 compat: add test for clock_nanosleep on darwin 2020-03-24 20:08:48 +01:00
Marvin Scholz
9999b4f54c compat: add clock_getres for darwin 2020-03-24 20:08:48 +01:00
Marvin Scholz
97fe588cbc compat: add clock_nanosleep for darwin 2020-03-24 20:08:48 +01:00
Marvin Scholz
f3f02e4ce8 compat: add clock_gettime for darwin 2020-03-24 19:56:36 +01:00
Alexandre Janniaux
a2e2cf0ab0 compat: lfind: fix warnings
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2020-02-20 10:02:47 +01:00
Rémi Denis-Courmont
cc129a71d7 Remove old mail address from sources 2019-09-04 22:11:04 +03:00
Rémi Denis-Courmont
778b577bec compat: provide dummy.c, simplify Makefile 2019-07-26 21:31:19 +03:00
Rémi Denis-Courmont
07e3b65d24 compat: test heap allocation replacements 2019-07-26 21:31:19 +03:00
Rémi Denis-Courmont
cd80b6ab72 compat: restore posix_memalign()
aligned_alloc() is not portably suitable for over-alignments.
posix_memalign()/memalign() are still needed.

This essentially reverts commit 34cd965645.
2019-07-26 21:31:19 +03:00
Rémi Denis-Courmont
577ba74815 compat: fix default aligned_alloc() 2019-07-26 21:31:19 +03:00
Rémi Denis-Courmont
fa48f95c85 compat: missing #include, fix warning 2019-04-14 10:04:37 +03:00
Thomas Guillem
b3eaf5a239 compat: remove qsort_r 2019-01-22 18:55:32 +01:00
Rémi Denis-Courmont
5ffb9dfe0e compat: replace qsort_r() where missing
This should sort properly on Windows and any other platform without
qsort_r(). It does _not_ fix any potential issues on any platforms with
an incompatible qsort_r() prototype (such as FreeBSD < 13).
2018-11-20 17:59:15 +02:00
Victorien Le Couviour--Tuffet
cf9bd77c67 compat: add lfind
Fixes android build with NDK 17 as lfind is not always available.
2018-10-23 14:53:25 +02:00
Rémi Denis-Courmont
893432c251 strlcpy: simplify 2018-06-17 11:23:11 +03:00
Steve Lhomme
f0a7bc050f compat: provide a win32 specific version of timespec_get
On mingw64 clock_gettime() is defined in winpthread which we don't want to use.

This implementation is based on the winpthread internal processing.
2018-05-15 18:34:30 +02:00
Steve Lhomme
83797ed765 compat: use proper check for the sys/uio.h availability 2018-04-12 14:21:06 +02:00
Steve Lhomme
333ed248b9 use the proper check for sys/socket.h availability 2018-04-12 13:19:23 +02:00
Kamil Rytarowski
b6968b7d36 Link libcompat with a library with math functions
We detect whether math functions are located in -lm in configure.ac.
Reuse the deliberable of this check and link libcompat with $(LIBM).
This is required at least for sincos() functions and it has been
reported as required on NetBSD 8.0.

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2018-03-13 23:03:20 +02:00
Rémi Denis-Courmont
833d3e8f91 compat: remove no longer used ffsll()
We don't need two ways to count trailing zeroes.
2018-02-25 21:39:23 +02:00
Rémi Denis-Courmont
5051dc1729 compat: remove shadowing variable 2018-02-22 21:50:09 +02:00
Thomas Guillem
3e0d833a3f compat: poll: work around event loss on WIN32
Signed-off-by: Steve Lhomme <robux4@videolabs.io>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2018-02-22 11:59:01 +01:00
Rémi Denis-Courmont
320938b4bf compat: add tdestroy()
This adds a thread-safe tdestroy() replacement for systems without it
but with tfind(). This should fix linking failures on BSD.
2018-02-20 21:42:43 +02:00
Etienne BRATEAU
ab0d479659 compat Properly check if NativeClient
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-07-06 17:27:58 +02:00
Steve Lhomme
c3a3afd3e3 core: add aligned_free to match the aligned_alloc used in the code
On Windows if you allocate aligned memory you need to free it with an aligned
version of free.

This is similar to the old vlc_memalign() + vlc_free()

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2017-06-22 09:15:07 +02:00
Rémi Denis-Courmont
6f00f3305c aligned_alloc: remove redundant preprocessor predicate 2017-06-19 18:05:30 +03:00
Rémi Denis-Courmont
34cd965645 compat: replace aligned_alloc() rather than posix_memalign() 2017-06-17 15:34:27 +03:00
Dennis Hamester
246f1ab22e compat: Add custom implementation of recvmsg/sendmsg on NaCl
On Pepper 49, recvmsg and sendmsg are implemented as stubs, which always
return ENOTSUP. Proper implementations for these functions will become
available in later Pepper versions, which should make these compat
functions obsolete.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-03-31 14:53:32 +02:00
Dennis Hamester
3e2accc82d compat: Add pathconf dummy replacement for nacl
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-03-31 14:53:32 +02:00
Julian Scheel
adb9c18776 compat: Add sigwait dummy for NaCl
Implement a sigwait dummy for NaCl, which relies on:
- NaCl does never send SIGPIPE to to apps (see
https://codereview.chromium.org/288063004/)
- VLC uses sigwait exclusively to wait for SIGPIPE

If sigwait is asked to wait for anything else than SIGPIPE it will run
into an assertion failure, so that breakage would not be silent.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-03-28 15:54:00 +02:00
Julian Scheel
4ad2ec6f24 newlib/nacl: Provide flockfile implementation
newlib provides an flockfile implementation via sys/io.h, which is
marked as internal. As we do not have a better alternative make use of
it here, albeit being marked as internal.

Signed-off-by: Julian Scheel <julian@jusst.de>
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2017-03-23 18:53:25 +02:00
Steve Lhomme
c02a90717c compat: the official way to include WSA functions is with winsock2.h
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2017-02-14 22:52:41 +01:00
Jean-Baptiste Kempf
95b7bf976a compat: ffsll use long long int as argument
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-12-22 16:18:03 +01:00
Rémi Denis-Courmont
fde9226ab2 win32: do not pretend to implement ftrylockfile()
This is not currently used anywhere in the code base anyway.
2016-11-20 11:48:47 +02:00
Rémi Denis-Courmont
90e14b835b compat: add sincos() and sincosf() replacements 2016-11-13 13:58:56 +02:00
Rémi Denis-Courmont
73e946f530 compat: fix test for tree functions
The standard functions are tdelete, tfind, tsearch and twalk. Testing
for non-standard tdestroy does not work properly: it leads to false
negative.
2016-10-23 20:06:30 +03:00
Steve Lhomme
6766a8903b compat: add realpath used by test_media_subitems()
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-10-10 23:53:55 +02:00
Denis Charmet
0ca74870c4 Use WSARecv instead of WSARecvFrom when the from field is empty
Windows will throw WSAEFAULT if WSARecvFrom is called with a NULL lpFrom and/or fromlen

Close #17163
2016-09-07 19:08:35 +02:00