|
24 | 24 | #include <string> |
25 | 25 | #include <vector> |
26 | 26 |
|
| 27 | +#ifndef LSL_CPP11 |
| 28 | +#if __cplusplus > 199711L || _MSC_VER >= 1900 || defined(LSL_DOXYGEN) |
| 29 | +/// Feature macro to conditionally enable C++11 features |
| 30 | +#define LSL_CPP11 1 |
| 31 | +#else |
| 32 | +#define LSL_CPP11 0 |
| 33 | +#endif |
| 34 | +#endif |
| 35 | + |
27 | 36 | extern "C" { |
28 | 37 | #include "lsl_c.h" |
29 | 38 | } |
@@ -363,7 +372,7 @@ class stream_info { |
363 | 372 | return *this; |
364 | 373 | } |
365 | 374 |
|
366 | | -#if __cplusplus > 199711L || _MSC_VER >= 1900 |
| 375 | +#if LSL_CPP11 |
367 | 376 | stream_info(stream_info &&rhs) noexcept : obj(rhs.obj) { rhs.obj = nullptr; } |
368 | 377 |
|
369 | 378 | stream_info &operator=(stream_info &&rhs) noexcept { |
@@ -845,6 +854,7 @@ class stream_outlet { |
845 | 854 | lsl_push_chunk_ctnp(obj, (data_buffer), (unsigned long)data_buffer_elements, |
846 | 855 | (timestamp_buffer), pushthrough); |
847 | 856 | } |
| 857 | + |
848 | 858 | void push_chunk_multiplexed(const std::string *data_buffer, const double *timestamp_buffer, |
849 | 859 | std::size_t data_buffer_elements, bool pushthrough = true) { |
850 | 860 | if (data_buffer_elements) { |
@@ -889,7 +899,7 @@ class stream_outlet { |
889 | 899 | if (obj) lsl_destroy_outlet(obj); |
890 | 900 | } |
891 | 901 |
|
892 | | -#if __cplusplus > 199711L || _MSC_VER >= 1900 |
| 902 | +#if LSL_CPP11 |
893 | 903 | /// stream_outlet move constructor |
894 | 904 | stream_outlet(stream_outlet &&res) noexcept : channel_count(res.channel_count), obj(res.obj) { |
895 | 905 | res.obj = nullptr; |
@@ -1031,7 +1041,7 @@ class stream_inlet { |
1031 | 1041 | if (obj) lsl_destroy_inlet(obj); |
1032 | 1042 | } |
1033 | 1043 |
|
1034 | | -#if __cplusplus > 199711L || _MSC_VER >= 1900 |
| 1044 | +#if LSL_CPP11 |
1035 | 1045 | /// Move constructor for stream_inlet |
1036 | 1046 | stream_inlet(stream_inlet &&rhs) noexcept : channel_count(rhs.channel_count), obj(rhs.obj) { |
1037 | 1047 | rhs.obj = nullptr; |
@@ -1491,7 +1501,7 @@ class stream_inlet { |
1491 | 1501 | chunk.reserve(chunk.size() + target * this->channel_count); |
1492 | 1502 | if (timestamps) timestamps->reserve(timestamps->size() + target); |
1493 | 1503 | while ((ts = pull_sample(sample, 0.0)) != 0.0) { |
1494 | | -#if __cplusplus > 199711L || _MSC_VER >= 1900 |
| 1504 | +#if LSL_CPP11 |
1495 | 1505 | chunk.insert(chunk.end(), std::make_move_iterator(sample.begin()), |
1496 | 1506 | std::make_move_iterator(sample.end())); |
1497 | 1507 | #else |
@@ -1806,7 +1816,7 @@ class continuous_resolver { |
1806 | 1816 | if (obj) lsl_destroy_continuous_resolver(obj); |
1807 | 1817 | } |
1808 | 1818 |
|
1809 | | -#if __cplusplus > 199711L || _MSC_VER >= 1900 |
| 1819 | +#if LSL_CPP11 |
1810 | 1820 | /// Move constructor for stream_inlet |
1811 | 1821 | continuous_resolver(continuous_resolver &&rhs) noexcept : obj(rhs.obj) { rhs.obj = nullptr; } |
1812 | 1822 | continuous_resolver &operator=(continuous_resolver &&rhs) noexcept { |
|
0 commit comments