[libcamera-devel] ipa: raspberrypi: Add functional include to pwl.h
diff mbox series

Message ID 20220728120128.283524-1-ecurtin@redhat.com
State Accepted
Headers show
Series
  • [libcamera-devel] ipa: raspberrypi: Add functional include to pwl.h
Related show

Commit Message

Eric Curtin July 28, 2022, 12:01 p.m. UTC
Was failing without this include on Fedora 36 compiler toolchain.

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
---
 src/ipa/raspberrypi/controller/pwl.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart July 28, 2022, 1:27 p.m. UTC | #1
Hi Eric,

Thank you for the patch.

On Thu, Jul 28, 2022 at 01:01:30PM +0100, Eric Curtin wrote:
> Was failing without this include on Fedora 36 compiler toolchain.

Could you tell what compiler and compiler version that is ? Could you
also please share the error message ?

> Signed-off-by: Eric Curtin <ecurtin@redhat.com>
> ---
>  src/ipa/raspberrypi/controller/pwl.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/ipa/raspberrypi/controller/pwl.h b/src/ipa/raspberrypi/controller/pwl.h
> index 546482cd..691c4700 100644
> --- a/src/ipa/raspberrypi/controller/pwl.h
> +++ b/src/ipa/raspberrypi/controller/pwl.h
> @@ -7,6 +7,7 @@
>  #pragma once
>  
>  #include <math.h>
> +#include <functional>

Alphabetical order please. I can fix that when applying, no need to send
a v2 just for this.

>  #include <vector>
>  
>  #include "libcamera/internal/yaml_parser.h"
Eric Curtin July 28, 2022, 2:37 p.m. UTC | #2
On Thu, 28 Jul 2022 at 14:27, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Eric,
>
> Thank you for the patch.
>
> On Thu, Jul 28, 2022 at 01:01:30PM +0100, Eric Curtin wrote:
> > Was failing without this include on Fedora 36 compiler toolchain.
>
> Could you tell what compiler and compiler version that is ? Could you
> also please share the error message ?

Fedora 36

gcc --version
gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

You can see the compiler error here:

https://github.com/ericcurtin/twincam/runs/7558719653

>
> > Signed-off-by: Eric Curtin <ecurtin@redhat.com>
> > ---
> >  src/ipa/raspberrypi/controller/pwl.h | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/src/ipa/raspberrypi/controller/pwl.h b/src/ipa/raspberrypi/controller/pwl.h
> > index 546482cd..691c4700 100644
> > --- a/src/ipa/raspberrypi/controller/pwl.h
> > +++ b/src/ipa/raspberrypi/controller/pwl.h
> > @@ -7,6 +7,7 @@
> >  #pragma once
> >
> >  #include <math.h>
> > +#include <functional>
>
> Alphabetical order please. I can fix that when applying, no need to send
> a v2 just for this.

Sorry I wasn't sure if you liked to split the C and C++ ones, took the
wrong guess and just sorted the C++ ones

>
> >  #include <vector>
> >
> >  #include "libcamera/internal/yaml_parser.h"
>
> --
> Regards,
>
> Laurent Pinchart
>
Laurent Pinchart July 28, 2022, 3:37 p.m. UTC | #3
Hi Eric,

On Thu, Jul 28, 2022 at 03:37:01PM +0100, Eric Curtin wrote:
> On Thu, 28 Jul 2022 at 14:27, Laurent Pinchart wrote:
> > On Thu, Jul 28, 2022 at 01:01:30PM +0100, Eric Curtin wrote:
> > > Was failing without this include on Fedora 36 compiler toolchain.
> >
> > Could you tell what compiler and compiler version that is ? Could you
> > also please share the error message ?
> 
> Fedora 36
> 
> gcc --version
> gcc (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)
> Copyright (C) 2022 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> You can see the compiler error here:
> 
> https://github.com/ericcurtin/twincam/runs/7558719653

Thank you. I've updated the commit message to


--------
ipa: raspberrypi: Add functional include to pwl.h

The Pwl class uses std::function, defined in <functional>, without
including the header directly. This results in a compilation error with
the Fedora 36 compiler toolchain (gcc 12.1.1):

In file included from ../src/ipa/raspberrypi/controller/rpi/awb.h:14,
                 from ../src/ipa/raspberrypi/controller/rpi/awb.cpp:14:
../src/ipa/raspberrypi/controller/rpi/../pwl.h:97:18: error: 'std::function' has not been declared
   97 |         void map(std::function<void(double x, double y)> f) const;
      |                  ^~~

Fix it by including <functional>.

Fixes: c1597f989654 ("ipa: raspberrypi: Use YamlParser to replace dependency on boost")
Signed-off-by: Eric Curtin <ecurtin@redhat.com>
--------

> > > Signed-off-by: Eric Curtin <ecurtin@redhat.com>
> > > ---
> > >  src/ipa/raspberrypi/controller/pwl.h | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/src/ipa/raspberrypi/controller/pwl.h b/src/ipa/raspberrypi/controller/pwl.h
> > > index 546482cd..691c4700 100644
> > > --- a/src/ipa/raspberrypi/controller/pwl.h
> > > +++ b/src/ipa/raspberrypi/controller/pwl.h
> > > @@ -7,6 +7,7 @@
> > >  #pragma once
> > >
> > >  #include <math.h>
> > > +#include <functional>
> >
> > Alphabetical order please. I can fix that when applying, no need to send
> > a v2 just for this.
> 
> Sorry I wasn't sure if you liked to split the C and C++ ones, took the
> wrong guess and just sorted the C++ ones

No worries :-)

> > >  #include <vector>
> > >
> > >  #include "libcamera/internal/yaml_parser.h"

Patch
diff mbox series

diff --git a/src/ipa/raspberrypi/controller/pwl.h b/src/ipa/raspberrypi/controller/pwl.h
index 546482cd..691c4700 100644
--- a/src/ipa/raspberrypi/controller/pwl.h
+++ b/src/ipa/raspberrypi/controller/pwl.h
@@ -7,6 +7,7 @@ 
 #pragma once
 
 #include <math.h>
+#include <functional>
 #include <vector>
 
 #include "libcamera/internal/yaml_parser.h"