Commit Graph

129 Commits

Author SHA1 Message Date
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
Rémi Denis-Courmont
d157ba1f08 memrchr: fix compilation 2016-07-17 22:40:28 +03:00
Jean-Baptiste Kempf
cfde608bb7 memrchr: try to fix macOS compilation 2016-07-17 21:29:40 +02:00
Jean-Baptiste Kempf
a051de1ac6 compat: add memrchr replacement
This is a very simple replacement. It probably can be better. Feel free.
2016-07-17 21:14:15 +02:00
Richard Diamond
810702d4ce compat: fix inet_pton declaration
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-07-06 14:13:37 +02:00
Steve Lhomme
f395afc090 compat: gettimeofday: unused variable
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-06-10 14:15:28 +02:00
Hugo Beauzée-Luyssen
d9c9233312 compat: Provide a gettimeofday replacement
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
2016-02-06 11:46:27 +01:00
Jean-Baptiste Kempf
50c5dc0a99 Compat: remove trailing spaces 2016-01-23 14:47:51 +01:00
Rémi Denis-Courmont
3f72fbddb7 compat: replace recvmsg() 2016-01-13 18:53:33 +02:00
Rémi Denis-Courmont
95ba2e83f1 compat: replace sendmsg() 2016-01-13 18:53:33 +02:00
KO Myung-Hun
c84a1a1aba src: os2: move gai_strerror() to compat
This fixes the following linkage error.

-----
  CCLD     libhttps_plugin.la
weakld: error: Unresolved symbol (UNDEF) '_gai_strerror'.
weakld: info: The symbol is referenced by:
    P:\tmp\ldconv_libvlc_http_la-transport_o_64fd5671f455159d80.obj
Ignoring unresolved externals reported from weak prelinker.
Error! E2028: _gai_strerror is an undefined reference
file P:/tmp\ldconv_libvlc_http_la-transport_o_64fd5671f455159d80.obj(ldconv_libvlc_http_la-transport_o_64fd5671f455159d80.obj): undefined symbol _gai_strerror
make.exe[4]: *** [libhttps_plugin.la] Error 1
-----

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2015-12-17 23:38:36 +02:00
KO Myung-Hun
ed7287c042 compat: remove 'const' from the prototype of timegm().
The prototype of timegm() does not have 'const'.

This fixes compilation on OS/2 which have only a declaration of
timegm().

Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2015-12-13 20:34:39 +02:00
Rémi Denis-Courmont
903664b8e5 compat: replace timegm() 2015-12-10 22:06:38 +02:00
Rémi Denis-Courmont
77874cb23e compat: missing #include 2015-12-10 19:55:18 +02:00
Hugo Beauzée-Luyssen
0f75899264 compat: Fix warning 2015-12-09 23:14:55 +01:00
Hugo Beauzée-Luyssen
12ee303dca compat: test: Fix strnstr tests 2015-12-09 20:38:37 +01:00
Hugo Beauzée-Luyssen
71001a361d test: Provide tests for our strnstr implementation 2015-12-09 18:33:06 +01:00
Rémi Denis-Courmont
383a9210b0 compat: add timespec_get() replacement 2015-12-09 19:15:46 +02:00
Hugo Beauzée-Luyssen
56fd4ad559 compat: Fix strnstr implementation 2015-12-09 18:04:38 +01:00
Rémi Denis-Courmont
32adc07bd6 strnstr: needle cannot be NULL 2015-10-26 19:36:14 +02:00
Francois Cartegnie
db41ce0a16 compat: fix strnstr
need to wake up sometimes :/
2015-10-07 19:39:48 +02:00
Francois Cartegnie
4c1238c772 compat: add strnstr 2015-10-07 16:25:25 +02:00
Hannes Domani
8b7059359c compat: cancel association of network events before close
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2015-07-20 20:37:15 +03:00
Rémi Denis-Courmont
5abe21ee48 vasprintf: missing #include 2015-07-06 22:50:25 +03:00
Rémi Denis-Courmont
67888a9779 Add replacement for GNU ffsll() 2015-06-28 15:19:49 +03:00