Skip to content

Commit e6477bc

Browse files
authored
Merge pull request #231 from zeyus/feature/c14-backport
Allow liblsl compilation with c++14.
2 parents de5cb3f + 082d129 commit e6477bc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/portable_archive/portable_iarchive.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,9 @@ class portable_iarchive : public portable_iprimitive
194194
// after reading the note above you still might decide to
195195
// deactivate this static assert and try if it works out.
196196
typename traits::bits bits;
197-
static_assert(sizeof(bits) == sizeof(T));
198-
static_assert(std::numeric_limits<T>::is_iec559);
197+
static_assert(sizeof(bits) == sizeof(T), "mismatching type sizes");
198+
static_assert(std::numeric_limits<T>::is_iec559,
199+
"floating point type does not conform to IEC 559 (IEEE 754)");
199200

200201
load(bits);
201202
traits::set_bits(t, bits);

src/sample.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ void lsl::sample::serialize(eos::portable_iarchive &ar, const uint32_t archive_v
356356
template <typename T> void test_pattern(T *data, uint32_t num_channels, int offset) {
357357
for (std::size_t k = 0; k < num_channels; k++) {
358358
std::size_t val = k + static_cast<std::size_t>(offset);
359-
if (std::is_integral_v<T>) val %= static_cast<std::size_t>(std::numeric_limits<T>::max());
359+
if (std::is_integral<T>::value) val %= static_cast<std::size_t>(std::numeric_limits<T>::max());
360360
data[k] = (k % 2 == 0) ? static_cast<T>(val) : -static_cast<T>(val);
361361
}
362362
}

0 commit comments

Comments
 (0)