Skip to content

Commit

Permalink
c++: Add missing "inline" keywords
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
pcercuei committed Oct 10, 2023
1 parent 1f48c1e commit d557859
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/cpp/iiopp.h
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ class ScanContext
}
};

std::shared_ptr<ScanContext> create_scan_context(optstr backend, int flags)
inline std::shared_ptr<ScanContext> create_scan_context(optstr backend, int flags)
{
iio_scan_context * ctx = iio_create_scan_context(backend ? static_cast<char const*>(*backend) : nullptr, flags);
if (!ctx)
Expand Down Expand Up @@ -781,7 +781,7 @@ class ScanBlock : public impl::IndexedSequence<ScanBlock, ContextInfo>

};

std::shared_ptr<ScanBlock> create_scan_block(optstr backend, int flags)
inline std::shared_ptr<ScanBlock> create_scan_block(optstr backend, int flags)
{
iio_scan_block * blk = iio_create_scan_block(backend ? static_cast<char const*>(*backend) : nullptr, flags);
if (!blk)
Expand Down

0 comments on commit d557859

Please sign in to comment.