From 95444ee6a8e7a5bf0e959c24735006d1543cb954 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Tue, 10 Oct 2023 14:50:26 +0200 Subject: [PATCH] c++: Add missing "inline" keywords The "inline" keywords must be present in function prototypes, otherwise these functions may end up defined multiple times in different source files, causing linking issues. Fixes #1066. Signed-off-by: Paul Cercueil --- bindings/cpp/iiopp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/cpp/iiopp.h b/bindings/cpp/iiopp.h index 4a1e3c134..60b5cfe04 100644 --- a/bindings/cpp/iiopp.h +++ b/bindings/cpp/iiopp.h @@ -743,7 +743,7 @@ class ScanContext } }; -std::shared_ptr create_scan_context(optstr backend, int flags) +inline std::shared_ptr create_scan_context(optstr backend, int flags) { iio_scan_context * ctx = iio_create_scan_context(backend ? static_cast(*backend) : nullptr, flags); if (!ctx) @@ -781,7 +781,7 @@ class ScanBlock : public impl::IndexedSequence }; -std::shared_ptr create_scan_block(optstr backend, int flags) +inline std::shared_ptr create_scan_block(optstr backend, int flags) { iio_scan_block * blk = iio_create_scan_block(backend ? static_cast(*backend) : nullptr, flags); if (!blk)