Fix apple clang compilation issues

This commit is contained in:
Eidolon 2023-12-14 22:45:53 -06:00
parent 88ee385ee3
commit 1db9898c42
3 changed files with 6 additions and 10 deletions

View file

@ -91,14 +91,10 @@ static AVRecorder::Config configure()
if (sound_started && cv_movie_sound.value)
{
cfg.audio = {
.sample_rate = 44100,
};
cfg.audio = { 44100 };
}
cfg.video = {
.frame_rate = cv_movie_fps.value,
};
cfg.video = { cv_movie_fps.value };
AVRecorder::Config::Video& v = *cfg.video;

View file

@ -66,7 +66,7 @@ struct Fixed
Fixed operator-() const { return -val_; }
#define X(op) \
template <typename T> \
template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>> \
Fixed operator op(const T& b) const { return val_ op b; } \
Fixed operator op(const Fixed& b) const \
{ \

View file

@ -21,7 +21,7 @@ Result SlopeAABBvsLine::vs_slope(const line_segment& l) const
LineEquation<unit> ql{l};
unit ls = copysign(kUnit, ql.m());
auto hit = [&](const vec2& k, unit xr, unit x, const vec2& n) -> Contact
auto hit = [&, &a = a, &b = b](const vec2& k, unit xr, unit x, const vec2& n) -> Contact
{
std::optional<vec2> k2;
@ -92,7 +92,7 @@ Result SlopeAABBvsLine::vs_slope(const line_segment& l) const
// xrs.x = x radius
// xrs.y = x sign
auto bind = [&](const vec2& k, const vec2& xrs, unit ns) -> std::optional<Contact>
auto bind = [&, &a = a, &b = b](const vec2& k, const vec2& xrs, unit ns) -> std::optional<Contact>
{
if (k.x < a.x)
{
@ -206,7 +206,7 @@ Result VerticalAABBvsLine::vs_slope(const line_segment& l) const
auto [a, b] = l.by_x(); // left, right
LineEquation<unit> ql{l};
auto hit = [&](const vec2& k, unit xr, unit y, const vec2& n) -> Contact
auto hit = [&, &a = a, &b = b](const vec2& k, unit xr, unit y, const vec2& n) -> Contact
{
std::optional<vec2> k2;