not all compat/ headers are marked as exporting, 2 reasons:
- some compat define own symbols, like platform_semafore or aligned_malloc
(not _alloc as in C11)
- some headers are too generic to export all symbols, eg. unistd.h
or windows.h
The includer needs no longer use IWYU pragmas for strcasecmp in *NIX.
In Windows, _stricmp is defined in string.h, which is not currently
exported (it contains more symbols so it isn't specific enough, in
contrary to POSIX strings.h which contains just strcasecmp and ffs
family).
ported changes from GPUJPEG, mostly cosmetic
For Win32 implementation, winsock2 is not used at all - Windows stdlib.h
contains _byteswap_* family so it is better to use these and not pull
the whole winsock2.h header struff (and also the winsock library but this
is irrelevannt for UG because we need to link with it unconditionally).
Corrected various spelling mistakes in comments, documentation, and
variable names across the project. Changes include:
- Documentation files (CONTRIBUTING.md, README.md, etc.)
- Source code comments in C/C++ files
- Function parameter names and descriptions
No functional changes were made.
The flags queried also for 64-bit ARM but it is empty there.
This does basically the same as the commit f46a101c, that adds
_FILE_OFFSET_BITS=64 define to config.h. But the config.h may not be
always included now.
+ compat/misc: typo in comment + assert 64b off_t (off_t should be
actually 64b in _OFF64 env and >= 64b in _OFFBIG so assert at least 64)
Sort sampling rates for poraudio playback that are tested if the device
doesn't support natively the received sample rate.
Use lowest higher or equal sampling rate if possible, if not, use the
highest usable sampling rate.
Also remove note in qsort_s.h (no longer valid - can be included where
approopriate, not only before first inclusion of stdlib.h).
It can be used in place of other network-related headers, not just for
htonl and family.
+ compat for fd_t and INVALID_SOCKET (that has been in config_*.h)
fixed:
```
Compiling src/rtp/rtpdec_h264.c...
In file included from src/rtp/rtpdec_h264.c:54:
In file included from src/rtp/rtp.h:40:
In file included from src/config_win32.h:78:
C:/msys64/clang64/include/winsock2.h:15:2: warning: Please include winsock2.h before windows.h [-W#warnings]
15 | #warning Please include winsock2.h before windows.h
```
Also include winsock2.h in blackmagic_common.hpp, because BMD includes include
windows.h and that would be included prior to compat/htonl.h.
The original mean was a bit cumbersome so rewrite it entirely in a more clean way.
It is now capable of playing the video produced by this UG command:
```
uv -t testcard -x rtsp:port=8654 -c lavc:enc=libx264:safe -V -A mp3 -s testcard
```
Note that the audio is still not fully implemented so that only video will
be presented. Neither this was possible before this change (audio control
was used instead of video due to buggy parsing).
moved compat functions from config_*h, namely:
- localtime_s/gmtime_s
- strerror_s
- mkdir Windows compat
- removed str[n]cmp from compat/misc (already in compat/strings,h,
which is the better location)
Do not use config*.h in export.c (motivation for the above changes).
Replaced all other autoconf-defined platform macros (HAVE_LINUX and
HAVE_MACOSX, WIN32 already done) with those ones defined by compiler.
Not yet remove the definitions from autoconf, in case someone will use
the old macros anyways. Remove in future.
- do not include config*h - for [nh]to[nl][sh] created a compat file,
because it is included in different headers in MSW and POSIX-compatible
systems
- include suggested headers by include-what-you-use
Include config.h directly if possible (to avoid obligating the includer
to do so).
Revert the condition to work better if HAVE_CONFIG_H is not defined -
unistd.h is included then.
Do not enforce the file to be either included before stdlib.h or stdlib.h
to be using __STDC_WANT_LIB_EXT1__ = 1. The bound checking API is
currently nowhere implemented, anyways, and we may use system native secure
qsort implementation (qsort_r in *NIX, MS variant of qsort_s).
The replacement was recently (since 6dfd098d) used even despite the
built-in has been implemented. The replacement was there because it
has supposedly better precision than the built-in. But since it is
no longer true (if it ever was), it is removed.
Note: there is also timespec_get (or UG wrapper get_time_in_ns) that can
be used in recent code instead of POSIX gettimeofday.
There is perhaps no need to use spin lock - pthread mutexes have low
overhead if no contention takes place, anyway.
+ replaced platform_spin with pthread_mutex in resource manager
+ document why resource manager is needed
It is a bit needless to compile the dlerror() commat in a huge number of
sources including that file. Moreover, the compat functions are not
direcly linked to modules' infrastructure in UG, which was piggy-backed
to.