Skip to content

Allow liblsl compilation with c++14. #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/portable_archive/portable_iarchive.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,9 @@ class portable_iarchive : public portable_iprimitive
// after reading the note above you still might decide to
// deactivate this static assert and try if it works out.
typename traits::bits bits;
static_assert(sizeof(bits) == sizeof(T));
static_assert(std::numeric_limits<T>::is_iec559);
static_assert(sizeof(bits) == sizeof(T), "mismatching type sizes");
static_assert(std::numeric_limits<T>::is_iec559,
"floating point type does not conform to IEC 559 (IEEE 754)");

load(bits);
traits::set_bits(t, bits);
Expand Down
2 changes: 1 addition & 1 deletion src/sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ void lsl::sample::serialize(eos::portable_iarchive &ar, const uint32_t archive_v
template <typename T> void test_pattern(T *data, uint32_t num_channels, int offset) {
for (std::size_t k = 0; k < num_channels; k++) {
std::size_t val = k + static_cast<std::size_t>(offset);
if (std::is_integral_v<T>) val %= static_cast<std::size_t>(std::numeric_limits<T>::max());
if (std::is_integral<T>::value) val %= static_cast<std::size_t>(std::numeric_limits<T>::max());
data[k] = (k % 2 == 0) ? static_cast<T>(val) : -static_cast<T>(val);
}
}
Expand Down
Loading