Skip to content

Commit

Permalink
Fix compilation with Apple Clang 13
Browse files Browse the repository at this point in the history
- Add missing include
- Remove unused lambda capture in FilterAlgo
- Capture `object` explicitly by value in Collect, because we're not allowed to capture structured bindings directly.
  • Loading branch information
johnhaddon committed Aug 31, 2023
1 parent 62d6ad1 commit 2b3fdf4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
1.3.x.x (relative to 1.3.2.0)
=======

Build
-----

- MacOS : Fixed compilation with Clang 13.

1.3.2.0 (relative to 1.3.1.0)
=======
Expand Down
2 changes: 2 additions & 0 deletions include/Gaffer/Collect.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#include "Gaffer/TypedObjectPlug.h"
#include "Gaffer/TypeIds.h"

#include <unordered_map>

namespace Gaffer
{

Expand Down
2 changes: 1 addition & 1 deletion src/Gaffer/Collect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ void Collect::compute( ValuePlug *output, const Context *context) const
{
dispatchPlugFunction(
input,
[&] ( auto *plug ) {
[&, object=object] ( auto *plug ) {
using OutputTraits = OutputTraits<remove_const_t<remove_pointer_t<decltype( plug )>>>;
auto typedObject = static_cast<typename OutputTraits::ObjectType *>( object );
OutputTraits::container( *typedObject )[index] = OutputTraits::collect( plug );
Expand Down
2 changes: 1 addition & 1 deletion src/GafferImage/FilterAlgo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ float GafferImage::FilterAlgo::sampleBox( Sampler &sampler, const V2f &p, float
float yFilterWeight = filter->yfilt( ( y + 0.5f - p.y ) * yscale );
sampler.visitPixels(
visitBounds,
[ &totalW, &v, &p, &pixelBounds, &scratchMemory, &yFilterWeight ] ( float value, int x, int y )
[ &totalW, &v, &pixelBounds, &scratchMemory, &yFilterWeight ] ( float value, int x, int y )
{
float w = scratchMemory[ x - pixelBounds.min.x ] * yFilterWeight;

Expand Down

0 comments on commit 2b3fdf4

Please sign in to comment.