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.
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 );
^~~~~~~~~~~~~~~
aligned_alloc() is not portably suitable for over-alignments.
posix_memalign()/memalign() are still needed.
This essentially reverts commit 34cd965645.
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).
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>
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>
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>
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>
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>