Skip to content

Commit 236362a

Browse files
jonkeanethisisnic
authored andcommitted
ARROW-14803: [R] Function not declared in scope
It looks like there was an order-of-imports issue and then one place where a return type wasn't quite right (when altrep wasn't defined). These changes make the old versions pass again (though there might be a better way to accomplish this!) Closes apache#11772 from jonkeane/r-versions-fix Authored-by: Jonathan Keane <jkeane@gmail.com> Signed-off-by: Nic Crane <thisisnic@gmail.com>
1 parent 8581f36 commit 236362a

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

r/src/altrep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ SEXP MakeAltrepVector(const std::shared_ptr<ChunkedArray>& chunked_array) {
706706

707707
bool is_arrow_altrep(SEXP) { return false; }
708708

709-
std::shared_ptr<Array> vec_to_arrow_altrep_bypass(SEXP x) { return nullptr; }
709+
std::shared_ptr<ChunkedArray> vec_to_arrow_altrep_bypass(SEXP x) { return nullptr; }
710710

711711
} // namespace altrep
712712
} // namespace r

r/src/arrow_cpp11.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@
4040
#define ALTREP_CLASS_SERIALIZED_CLASS(x) ATTRIB(x)
4141
#define ALTREP_SERIALIZED_CLASS_PKGSYM(x) CADR(x)
4242

43+
#if (R_VERSION < R_Version(3, 5, 0))
44+
#define LOGICAL_RO(x) ((const int*)LOGICAL(x))
45+
#define INTEGER_RO(x) ((const int*)INTEGER(x))
46+
#define REAL_RO(x) ((const double*)REAL(x))
47+
#define COMPLEX_RO(x) ((const Rcomplex*)COMPLEX(x))
48+
#define STRING_PTR_RO(x) ((const SEXP*)STRING_PTR(x))
49+
#define RAW_RO(x) ((const Rbyte*)RAW(x))
50+
#define DATAPTR_RO(x) ((const void*)STRING_PTR(x))
51+
#define DATAPTR(x) (void*)STRING_PTR(x)
52+
#endif
53+
4354
namespace arrow {
4455
namespace r {
4556

r/src/arrow_types.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,6 @@ std::shared_ptr<arrow::RecordBatch> RecordBatch__from_arrays(SEXP, SEXP);
7575
arrow::MemoryPool* gc_memory_pool();
7676
arrow::compute::ExecContext* gc_context();
7777

78-
#if (R_VERSION < R_Version(3, 5, 0))
79-
#define LOGICAL_RO(x) ((const int*)LOGICAL(x))
80-
#define INTEGER_RO(x) ((const int*)INTEGER(x))
81-
#define REAL_RO(x) ((const double*)REAL(x))
82-
#define COMPLEX_RO(x) ((const Rcomplex*)COMPLEX(x))
83-
#define STRING_PTR_RO(x) ((const SEXP*)STRING_PTR(x))
84-
#define RAW_RO(x) ((const Rbyte*)RAW(x))
85-
#define DATAPTR_RO(x) ((const void*)STRING_PTR(x))
86-
#define DATAPTR(x) (void*)STRING_PTR(x)
87-
#endif
88-
8978
#define VECTOR_PTR_RO(x) ((const SEXP*)DATAPTR_RO(x))
9079

9180
namespace arrow {

0 commit comments

Comments
 (0)