Commit Graph

678 Commits

Author SHA1 Message Date
Rémi Denis-Courmont 2102849ee4 include: remove legacy GCC version checks
According to NEWS, we require GCC 8.0 or later, so there are is point
checking for 5.0 or 6.0 any longer.
2024-02-20 08:52:57 +00:00
Rémi Denis-Courmont 0fca15d73c include: remove ad-hoc count_leading_zeros functions 2024-01-06 13:23:18 +00:00
Steve Lhomme 041b39df69 vlc_variables: move vlc_value_t structure in vlc_variables.h
It's only referenced in that header.
2023-12-03 08:36:03 +00:00
Steve Lhomme 44dc55e3bd vlc_variables: move vlc_callback_t signature in vlc_variables.h
It's mostly used for var_AddCallback() and filter callbacks. But vlc_common.h
currently includes vlc_variables.h so it's still available there.
2023-12-03 08:36:03 +00:00
Steve Lhomme 63556b9acc vlc_variables: move list_callback signature in vlc_variables.h
It's not needed outside of variables.
2023-12-03 08:36:03 +00:00
Steve Lhomme 483463cae6 vlc_common: don't include windows.h
Code doing Windows specific calls need to do the include themselves.

We should not always include windows.h because it should not be included before
winsock headers.
2023-07-05 13:47:59 +00:00
Steve Lhomme a9ebdb9077 vlc_common: don't include vlc_configuration.h anymore
We don't use a config_ChainXXX or config_Get/PutXXX, in this file.
2023-05-06 06:56:32 +00:00
Steve Lhomme e2c989a5c1 vlc_common: don't include vlc_arrays.h anymore
We don't use a vlc_array_t, vlc_dictionarry_t, TAB_xxx or
realloc_or_free() in this file.
2023-05-04 10:00:11 +00:00
Steve Lhomme 064d60406c vlc_arrays: move ARRAY_SIZE in vlc_common
It's a common C helper, not specific to VLC arrays.
2023-05-04 10:00:11 +00:00
Steve Lhomme 80ea761c63 vlc_common: don't include vlc_thread.h anymore
We don't use a vlc_thread, vlc_muted, vlc_tick_now in this file.
2023-04-27 19:44:35 +00:00
Steve Lhomme 2c9263067d vlc_common: don't include vlc_tick.h anymore
We don't use a vlc_tick.h in this file.
2023-04-25 09:29:52 +02:00
Steve Lhomme b2a7a5b374 vlc_common: remove redirections to mingw printf functions
This is the job of mingw-w64 to pick the proper variant when we set
__USE_MINGW_ANSI_STDIO. In fact when including stdio.h it undefines our defines.
2023-01-31 09:11:53 +00:00
Steve Lhomme c74f0a8e07 vlc_common: remove unused swprintf
It would use the proper call via mingw-w64 anyway.
2023-01-31 09:11:53 +00:00
Steve Lhomme 39039374c3 configure: remove defines used with __USE_MINGW_ANSI_STDIO
The PRId64, PRIi64, etc. are properly defined since at least mingw-w64 5 which
is the minimum we support.

snprintf, vsnprintf and swprintf officially exists in the Windows SDK and in
mingw-w64 5.
2023-01-31 09:11:53 +00:00
Steve Lhomme cac3057f62 vlc_common: use _swab instead of swab
It requires linking with oldname.lib. We can use _swab directly for win32 code.
2023-01-20 08:10:14 +00:00
Steve Lhomme 233b54fc21 vlc_common: set VLC_USED/VLC_MALLOC/VLC_DEPRECATED for MSVC
The proper values don't work everywhere as they are not always put in the right
place.
2023-01-17 11:33:05 +00:00
Steve Lhomme 352ad101b3 rename __LIBVLC__ to LIBVLC_INTERNAL_
define names starting with 2 underscore are reserved.

https://devblogs.microsoft.com/oldnewthing/20230109-00/?p=107685
2023-01-17 10:37:49 +00:00
Steve Lhomme c952eb4eaf separate defines to export DLL functions
libvlc cannot have the VLC DLL export define set.
2023-01-12 14:50:21 +00:00
Rémi Denis-Courmont 9d78b14ed1 win32: don't define PATH_MAX
That's only used once in the entire code base, in a Linux-specific file.
2023-01-08 08:55:54 +00:00
Steve Lhomme 36d83f710e vlc_common: don't redefine off_t to a larger type on Windows
That makes our usage of mingw-w64 structures like stat, _stat32, _stat64i32
invalid. Plus calls to functions expecting a smaller type.

If we need a bigger type, we need to use our own.

We already set _FILE_OFFSET_BITS so that off_t can be larger than usual.
2023-01-07 22:21:26 +00:00
Steve Lhomme fe48cc9f73 vlc_common: add missing defines when not compiled with gcc/clang 2023-01-06 14:46:46 +00:00
Steve Lhomme 816af9928d vlc_common: don't use __has_attribute() if it's not defined
That's how it's done in other places.
2023-01-06 14:46:46 +00:00
Steve Lhomme 0ef983754b vlc_common: define more attribute based defines using __has_attribute
Leave VLC_DEPRECATED_ENUM, VLC_FORMAT and VLC_FORMAT_ARG for now as they are
more compiler specific.
2022-05-20 05:07:42 +00:00
Steve Lhomme 072f13a81d vlc_common: add some function attribute defines
They should exist for gcc and clang.

We could also use __has_c_attribute() and the [[]] C23 notation when available.
2022-05-20 05:07:42 +00:00
Lyndon Brown 4d89ef900d fix mis-spelling of overridden
a followup to !1044.
2022-01-13 07:31:11 +00:00
Thomas Guillem fbbc06b6bf core: rename block_fifo_t to vlc_fifo_t
The vlc_fifo_t name already existed and was a typedef to block_fifo_t.

But leave the old block_Fifo/block_fifo_t name via
 - typedef struct vlc_fifo_t block_fifo_t;
 - defines of functions, struct and defines

Refs #18762
2021-12-23 21:24:01 +00:00
Thomas Guillem dd1c4288bc core: rename block_t to vlc_frame_t
But leave the old block_t name via
 - typedef struct vlc_frame_t block_t;
 - defines of functions, struct and defines

vlc_fifo will be handled in the next commit.

Refs #18762
2021-12-23 21:24:01 +00:00
Rémi Denis-Courmont 2d80a67524 include: use negated standard error codes 2021-09-13 18:20:49 +03:00
Rémi Denis-Courmont 83541df6fa include: map VLC_EGENERIC to INT_MIN
VLC_EGENERIC has no equivalent in <errno.h>, so it should not alias any
<errno.h> value. This maps it to INT_MIN. It works because -INT_MIN equals
INT_MAX + 1, which is out of range of `int`. As a reminder codes in
<errno.h> are positive integers.

The convoluted definition is to avoid pulling <limits.h> into
<vlc_common.h> and from there all over the code base.
2021-09-13 18:20:48 +03:00
Mehdi Sabwat 832400acf9 core: add initial support for emscripten
posix/sort.c won't be added because qsort_r is not supported.

- add vlc_getProxyUrl stub for emscripten

- implement vlc_thread_id() for emscripten

- add weak attribute support for wasm

Co-Authored-By: Jean-Baptiste Kempf <jb@videolan.org>
2021-09-12 09:37:27 +00:00
Rémi Denis-Courmont a2476d06e2 sout: remove sout_instance_t for real
(also sout_cfg_t)
2021-07-15 17:23:03 +00:00
Rémi Denis-Courmont 3e55700963 sout: remove sout_instance_t indirection
This just wraps a sout_stream_t. We get more flexibility by using
sout_stream_t directly.
2021-07-15 17:23:03 +00:00
Rémi Denis-Courmont f32f289264 Rationalise not found error codes
We don't need 4 different codes for essentially the same thing, which
is that a certain thing could not be found.
2021-07-14 14:53:16 +00:00
Rémi Denis-Courmont dd20ace531 Rename VLC_EBADVAR to VLC_EINVAL 2021-07-14 14:53:16 +00:00
Rémi Denis-Courmont aebb111024 Introduce VLC_ENOTSUP error code
Better than VLC_EGENERIC when something is understood to be unsupported
on the local system.
2021-07-14 14:53:16 +00:00
Rémi Denis-Courmont 2e4165c0cc Introduce VLC_EACCES error code
EACCES means that an operation is not possible in the current state.

This is not to be confused with EPERM meaning that the user does not
have the necessary credentials. Also compare HTTP results 401 and 403.

Also compare with EINVAL (VLC_EBARVAR) meaning that operating is not
possible because the value of a parameter is invalid.
2021-07-14 14:53:16 +00:00
Steve Lhomme c3748d50f4 common: don't use [static] in C++ code
This is a C99 thing.
2021-07-12 08:33:35 +02:00
Hugo Beauzée-Luyssen 626a5d9a16 vlc_common: Provide an unreachable() implementation for MSVC 2021-01-25 18:43:41 +01:00
Romain Vimont 93f9591d9f vlc_common: remove old playlist typedefs
Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2020-11-12 15:08:03 +01:00
Marvin Scholz 828fafb3d9 src: remove old md5 API 2020-04-16 12:06:12 +02:00
Marvin Scholz d18cd34a49 vlc_common: move decoder_synchro_t to synchro.h 2020-03-26 09:13:49 +01:00
Marvin Scholz dff305c34b vlc_common: add vlc_align helper 2020-03-24 18:50:15 +01:00
Thomas Guillem c2a4de8137 input: make the input_source_t struct public
But continue to hide its definition and usage. It will just be used to passed
from demuxers to the display es_out that will actually use it.
2020-02-28 20:29:35 +01:00
Steve Lhomme a9e0b1124e vlc_common: fix swab() calls on win32 that don't use const on source pointer 2019-07-19 15:19:16 +02:00
Thomas Guillem 9dc34b4205 input: hide input_thread_t 2019-06-03 16:15:55 +02:00
Rémi Denis-Courmont 32bc2c18cf misc: remove unused vlc_error_string() 2019-05-28 19:56:08 +03:00
Steve Lhomme 16040ccb7a do not use tchar.h in VLC
We don't include tchar.h anymore, nor TCHAR, nor the *tcs* APIs. Using any of
these will fail to compile if tchar.h is not included. In MinGW it's never
included through other headers.

We don't need _UNICODE either which is specific to tchar.h.
2019-04-03 10:28:50 +02:00
Rémi Denis-Courmont 3e8986472a Rename vlc_error() to vlc_error_string()
As a sort of VLC equivalent for strerror(), it is tempting to call it
vlc_strerror()... but that is already taken for converting actual
standard error codes to strings.
2019-03-04 22:02:35 +02:00
Thomas Guillem 599ad7a13d vlc_common: implement VLC_WEAK for MACH-O 2019-01-22 18:28:53 +01:00
Thomas Guillem 8443136fd7 vlc_common: don't use doc inline comments for defines
Otherwise, the comment is included on every doc that mention these defines.
2018-10-19 12:09:54 +02:00