Skip to content

Commit a91c3ed

Browse files
committed
Define SET_COMPLEX_ELT if not defined
1 parent 66b4ade commit a91c3ed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

inst/include/cpp11/complexes.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
#include "cpp11/r_vector.hpp" // for r_vector, r_vector<>::proxy
1212
#include "cpp11/sexp.hpp" // for sexp
1313

14+
// Define SET_COMPLEX_ELT if not defined
15+
// for compatibility with older R versions, such as ubuntu 20.04 oldrel-4
16+
#ifndef SET_COMPLEX_ELT
17+
#define SET_COMPLEX_ELT(x, i, v) (COMPLEX(x)[i] = v)
18+
#endif
19+
1420
namespace cpp11 {
1521

1622
// Specializations for complex numbers

0 commit comments

Comments
 (0)