libcamera: yaml_parser: Add support for float types
The YamlObject::get<T>() function template has a specialization for double but not for float. When used in an IPA module, the issue is caught at module load time only, when dynamic links are resolved, causing errors such as Failed to open IPA module shared object: /usr/lib/libcamera/ipa_rkisp1.so: undefined symbol: _ZNK9libcamera10YamlObject6GetterIfE3getERK_ Fix it by adding a float specialization. The alternative would be to use double only in IPA modules, but the lack of enforcement at compile time makes this dangerous. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
This commit is contained in:
@@ -177,6 +177,7 @@ public:
|
||||
template<typename T,
|
||||
std::enable_if_t<
|
||||
std::is_same_v<bool, T> ||
|
||||
std::is_same_v<float, T> ||
|
||||
std::is_same_v<double, T> ||
|
||||
std::is_same_v<int8_t, T> ||
|
||||
std::is_same_v<uint8_t, T> ||
|
||||
|
||||
Reference in New Issue
Block a user