The previous attempt to clarify an out of memory exception/crash
resulted in the compiler optimizing os_breakpoint() and os_oom() into
the same result, which meant that crash stacks in the wild were still
not specific enough to be helpful. Forcefully differentiating the
functions in Release configuration by having os_breakpoint() only call
__debugbreak() and having os_oom() call RaiseException() should give us
clearer crash stacks.
Amends 94a736f179.
Partial revert of a0eae6f33c.
Partial revert of 23c3ad4d02.
Partial revert of 97b34ebb76.
Keep all of the get_plugin_info stuff, remove the Qt5 checks.
RTLD_LAZY means that symbols will only be resolved when first used,
while RTLD_NOW tries to resolve them immediately. This means that if
there are missing symbols (e.g, because a function got removed from
libobs), dlopen with RTLD_LAZY will happily open that module but we get
a runtime crash when the module tries to use that symbol, while with
RTLD_NOW we instead get a (nicer) error on dlopen.
On MSVC, PRAGMA_WARN_DEPRECATION already does that, but on other
compilers it still throws a warning. PRAGMA_DISABLE_DEPRECATION is for
(rare) situations where it's intentional and correct that the deprecated
API is still used, such as to make sure some other API still works
internally.
SIMD Everywhere finder needs to be installed alongside libobs CMake
package since its headers depends on it.
C++ cmath header is included on Windows on ARM to ensure that all math
functions are correctly defined when included in C++ code.
https://github.com/simd-everywhere/simde/issues/1304
macOS intrinsics is included to make sure that no redefinition error
happens.
Create a specific "out of memory" variant of os_breakpoint to facilitate
troubleshooting and to differentiate an "out of memory" crash from a
more generic crash.
FreeBSD already implemented os_get_free_size. Move the new Linux
implementation into the existing not-__FreeBSD__ block.
Fixes: 935613816f ("libobs/util: Update `os_get_free_size()`")
This fixes a regression on Linux, introduced in commit 9bc3082.
According to the POSIX specification for the exec family of commands,
"The first argument is the filename or pathname of the executable to
be executed". This was done correctly before, but the above commit
removed "sh" from the arguments, breaking the pipe function on Linux.
The frontend has set a log handler which locks the mutex in `LogString`.
If `os_dlopen` fails in the child process, it calls `blog` and attempted
to lock the mutex that may have already been locked by another thread
before `fork()`. This change prevents the child process from locking the
mutex, resolving the potential deadlock.
That is, leave only the code that was under USE_XDG. Previously the
Linux CMake build defined USE_XDG unconditionally, while it was not set
by the FreeBSD build.
The non-USE_XDG code was broken, and FreeBSD should follow the XDG
convention anyway (in particular, storing config files typically under
$HOME/.config/obs-studio). Defining USE_XDG in the os-freebsd.cmake
files would leave the non-USE_XDG code unused anywhere, so instead just
remove it.
As outlined in c5965c8605, bmalloc(0) is
pretty much always a mistake, possibly hiding other bugs.
It's been two years since that commit introduced a warning announcing
that this will crash in a future version of OBS, let's make that happen.
Avoid creating the screensaver inhibitor thread when another method has
been applied.
Make inhibition unavailable in a Flatpak if portal is not available.
New space availability keys seem to have very specific file system
requirements not documented anywhere. Using the opportunistic free
space key opportunistically (and falling back on the legacy value
otherwise) should always yield a "good-enough" free disk space value.
Transition from using popen() to using fork()/dup2()/execl() to provide
a way to read stderr from ffmpeg.
Co-Authored by: PatTheMav <PatTheMav@users.noreply.github.com>