Skip to content

Commit 2971659

Browse files
committed
replace old linux check
1 parent c8265a3 commit 2971659

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cpp4rtest/src/test-complex.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#include <testthat.h>
22

33
// Helper to initialize Rcomplex portably across compilers
4-
// Modern compilers prefer {{r,i}} but older compilers don't support it
4+
// Modern compilers with C++17+ prefer {{r,i}} but older standards don't support it
55
#if (defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)) || \
6-
(defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 8)
7-
// MinGW on Windows or older GCC - use direct member initialization with different param names
6+
(defined(__GNUC__) && !defined(__clang__) && __cplusplus < 201703L)
7+
// MinGW on Windows or pre-C++17 - use direct member initialization with different param names
88
#define MAKE_RCOMPLEX(real, imag) []() { Rcomplex c; c.r = (real); c.i = (imag); return c; }()
99
#else
10-
// Modern compilers - use aggregate initialization
10+
// Modern compilers with C++17+ - use aggregate initialization
1111
#define MAKE_RCOMPLEX(r, i) Rcomplex{{r, i}}
1212
#endif
1313

cpp4rtest/src/test-r_complex.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#include <testthat.h>
22

33
// Helper to initialize Rcomplex portably across compilers
4-
// Modern compilers prefer {{r,i}} but older compilers don't support it
4+
// Modern compilers with C++17+ prefer {{r,i}} but older standards don't support it
55
#if (defined(_WIN32) && defined(__GNUC__) && !defined(__clang__)) || \
6-
(defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 8)
7-
// MinGW on Windows or older GCC - use direct member initialization with different param names
6+
(defined(__GNUC__) && !defined(__clang__) && __cplusplus < 201703L)
7+
// MinGW on Windows or pre-C++17 - use direct member initialization with different param names
88
#define MAKE_RCOMPLEX(real, imag) []() { Rcomplex c; c.r = (real); c.i = (imag); return c; }()
99
#else
10-
// Modern compilers - use aggregate initialization
10+
// Modern compilers with C++17+ - use aggregate initialization
1111
#define MAKE_RCOMPLEX(r, i) Rcomplex{{r, i}}
1212
#endif
1313

0 commit comments

Comments
 (0)