1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 05:15:12 +00:00
mpv/input
wm4 cc54377463 Do not call strerror()
...because everything is terrible.

strerror() is not documented as having to be thread-safe by POSIX and
C11. (Which is pretty much bullshit, because both mandate threads and
some form of thread-local storage - so there's no excuse why
implementation couldn't implement this in a thread-safe way. Especially
with C11 this is ridiculous, because there is no way to use threads and
convert error numbers to strings at the same time!)

Since we heavily use threads now, we should avoid unsafe functions like
strerror().

strerror_r() is in POSIX, but GNU/glibc deliberately fucks it up and
gives the function different semantics than the POSIX one. It's a bit of
work to convince this piece of shit to expose the POSIX standard
function, and not the messed up GNU one.

strerror_l() is also in POSIX, but only since the 2008 standard, and
thus is not widespread.

The solution is using avlibc (libavutil, by its official name), which
handles the unportable details for us, mostly. We avoid some pain.
2014-11-26 21:21:56 +01:00
..
cmd_list.c input: simplify 2014-11-24 16:48:34 +01:00
cmd_list.h input: simplify 2014-11-24 16:48:34 +01:00
cmd_parse.c input: simplify 2014-11-24 16:48:34 +01:00
cmd_parse.h command: print executed commands with -v 2014-10-23 15:13:05 +02:00
event.c input: use mpv_node parser for char** command parsers 2014-10-10 22:58:28 +02:00
event.h Move compat/ and bstr/ directory contents somewhere else 2014-08-29 12:31:52 +02:00
input.c input: simplify 2014-11-24 16:48:34 +01:00
input.h input: simplify 2014-11-24 16:48:34 +01:00
ipc.c lua, ipc: remove leftovers 2014-11-24 10:33:55 +01:00
joystick.c Do not call strerror() 2014-11-26 21:21:56 +01:00
keycodes.c Remove some unneeded NULL checks 2014-11-21 09:58:09 +01:00
keycodes.h input: make key bindings like "Shift+X" work (for ASCII) 2014-08-26 20:39:28 +02:00
lirc.c Do not call strerror() 2014-11-26 21:21:56 +01:00
pipe-win32.c input: use libwaio for pipe input on Windows 2014-09-14 16:24:01 +02:00