[libcamera-devel] [PATCH] libcamera: ipu3: Fix compilation issues with gcc5
Jacopo Mondi
jacopo at jmondi.org
Mon Aug 3 18:28:11 CEST 2020
GCC5 does not provide prototypes for the math library functions defined
in the math.h header for the std:: namespace.
Include the C++ <cmath> header in place of <math.h> as it defines
overloads for the std::abs and std::fmod function.
This goes intentionally against the libcamera coding guidelines, and
is reported as warning by checkpatch.py.
Fixes: 968ab9bad0ed ("libcamera: ipu3: imgu: Calculate ImgU pipe configuration")
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/libcamera/pipeline/ipu3/imgu.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp
index b7593ceb3672..eb829e096561 100644
--- a/src/libcamera/pipeline/ipu3/imgu.cpp
+++ b/src/libcamera/pipeline/ipu3/imgu.cpp
@@ -7,8 +7,8 @@
#include "imgu.h"
+#include <cmath>
#include <limits>
-#include <math.h>
#include <linux/media-bus-format.h>
--
2.27.0
More information about the libcamera-devel
mailing list