It seems that it became a macro in some files on macosx now...
../../include/vlc_fixups.h:763:6: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/simd/math.h:2459:49: note: expanded from macro 'sincos'
2459 | #define sincos(__x, __sinp, __cosp) __tg_sincos(__tg_promote1((__x))(__x), __sinp, __cosp)
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/tgmath.h:60:39: note: expanded from macro '__tg_promote1'
60 | #define __tg_promote1(__x) (__typeof__(__tg_promote(__x)))
| ^
In file included from ../../modules/gui/macosx/views/VLCSnowEffectView.m:25:
In file included from ../../modules/gui/macosx/main/VLCMain.h:27:
In file included from ../config.h:898:
../../include/vlc_fixups.h:763:6: error: function cannot return function type 'int (double)'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/simd/math.h:2459:49: note: expanded from macro 'sincos'
2459 | #define sincos(__x, __sinp, __cosp) __tg_sincos(__tg_promote1((__x))(__x), __sinp, __cosp)
| ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/tgmath.h:60:38: note: expanded from macro '__tg_promote1'
60 | #define __tg_promote1(__x) (__typeof__(__tg_promote(__x)))
| ^
3 errors generated.
This way we won't use API calls not available on Xbox.
We might as well set it for MSVC desktop builds too to make sure we always
keep Xbox compatibility.
These functions are not available when linking, so we should avoid using them.
Also mingw-w64 understands _CRT_NONSTDC_NO_DEPRECATE but not
_CRT_NONSTDC_NO_WARNINGS.
restrict is forcibly defined to __restrict for C++ compatibility, even with cl.exe.
And __declspec(__restrict) is not valid, it creates a lot of warnings.
The existence of search.h is not relevant for that. search.h may exist but does
not provide tfind, as on Windows.
If tfind.c is included for compilation, then the code needs to be built.
We only need to define them if they are used in an API but they are not. The
names are very generic and may collide with some defines, so avoid potential
compilation issues.
Only the VISIT enum is needed by twalk().
So that we don't have to include search.h each time vlc_fixups.h is used.
The Win32 prototype of lfind() expects an unsigned* for 'nelp', not a size_t*.
This fixes a compilation error on OS/2:
-----
CC stream_out/udp.lo
stream_out/udp.c: In function 'CreateSDP':
stream_out/udp.c:89:16: error: 'INET6_ADDRSTRLEN' undeclared (first use in this function); did you mean 'INET_ADDRSTRLEN'?
89 | char dhost[INET6_ADDRSTRLEN];
| ^~~~~~~~~~~~~~~~
| INET_ADDRSTRLEN
stream_out/udp.c:89:16: note: each undeclared identifier is reported only once for each function it appears in
stream_out/udp.c:89:10: warning: unused variable 'dhost' [-Wunused-variable]
89 | char dhost[INET6_ADDRSTRLEN];
| ^~~~~
-----
When compiling and not having writev/readv, the following error happens:
make[2]: Entering directory '/home/janniaux/Projects/videolabs/vlc/build-tsan/compat'
CC strlcpy.lo
CC strnstr.lo
In file included from ../config.h:952,
from ../../compat/strnstr.c:22:
../../include/vlc_fixups.h:232:1: error: unknown type name ‘ssize_t’; did you mean ‘size_t’?
232 | ssize_t readv(int, const struct iovec *, int);
| ^~~~~~~
| size_t
In file included from ../config.h:952,
from ../../compat/strlcpy.c:22:
../../include/vlc_fixups.h:232:1: error: unknown type name ‘ssize_t’; did you mean ‘size_t’?
232 | ssize_t readv(int, const struct iovec *, int);
| ^~~~~~~
| size_t
../../include/vlc_fixups.h:237:1: error: unknown type name ‘ssize_t’; did you mean ‘size_t’?
237 | ssize_t writev(int, const struct iovec *, int);
| ^~~~~~~
| size_t
../../include/vlc_fixups.h:237:1: error: unknown type name ‘ssize_t’; did you mean ‘size_t’?
237 | ssize_t writev(int, const struct iovec *, int);
| ^~~~~~~
| size_t
make[2]: *** [Makefile:1531: strnstr.lo] Error 1
win64 has its own version of lfind() but assumes the 3rd parameter is an
unsigned.
This commit matches the #ifdef _WIN64 below this code which uses the Windows
version with the unsigned limit. The comment is copied from there as well.
Replace typeof by a decltype()-based equivalent on compilers not
supporting typeof.
Decltype is not equivalent to typeof, but we are mostly concerned about
removing references from the type, since it has no use in C code like
VLC list.
Note that this fixup is there to fix the usage of headers using typeof
in C++ code, not to provide "typeof" directly C++ to replace decltype.
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 );
^~~~~~~~~~~~~~~
It may link with iphlpapi but be forbidden in UWP.
This test relies on the fact that -Werror-implicit-function-declaration works
in the compiler. And that's why it's done after it's enabled.
It's only used for the --miface option to set the preferred multicast interface.
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).