[v5,6/7] libcamera: base: shared_fd: Add hash template
diff mbox series

Message ID 20260706113900.2530549-7-bryan.odonoghue@linaro.org
State New
Headers show
Series
  • libcamera: software_isp: gpu: Add go faster stripes
Related show

Commit Message

Bryan O'Donoghue July 6, 2026, 11:38 a.m. UTC
From: Robert Mader <robert.mader@collabora.com>

Suggested-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 Documentation/Doxyfile-common.in   | 2 ++
 include/libcamera/base/shared_fd.h | 9 +++++++++
 2 files changed, 11 insertions(+)

Patch
diff mbox series

diff --git a/Documentation/Doxyfile-common.in b/Documentation/Doxyfile-common.in
index f11ec593d..c0696496c 100644
--- a/Documentation/Doxyfile-common.in
+++ b/Documentation/Doxyfile-common.in
@@ -75,3 +75,5 @@  PREDEFINED             = __DOXYGEN__ \
 			 @PREDEFINED@
 
 HAVE_DOT               = YES
+
+BUILTIN_STL_SUPPORT    = YES
diff --git a/include/libcamera/base/shared_fd.h b/include/libcamera/base/shared_fd.h
index 61fe11c1d..65b1044c7 100644
--- a/include/libcamera/base/shared_fd.h
+++ b/include/libcamera/base/shared_fd.h
@@ -7,6 +7,7 @@ 
 
 #pragma once
 
+#include <functional>
 #include <memory>
 
 namespace libcamera {
@@ -57,3 +58,11 @@  static inline bool operator!=(const SharedFD &lhs, const SharedFD &rhs)
 }
 
 } /* namespace libcamera */
+
+template<>
+struct std::hash<libcamera::SharedFD> : private std::hash<int> {
+	auto operator()(const libcamera::SharedFD &x) const noexcept
+	{
+		return std::hash<int>::operator()(x.get());
+	}
+};