Skip to content

Commit

Permalink
Fix gcc compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jun 25, 2024
1 parent 3bd63a8 commit e797c53
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/duckdb_r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#include "Rdefines.h"
#include <dlfcn.h>

#include <cstdint>


#ifdef _WIN32

Expand Down Expand Up @@ -81,4 +83,4 @@ void R_init_duckdbneo(DllInfo *dll) {
R_useDynamicSymbols(dll, FALSE);
R_forceSymbols(dll, TRUE);
}
}
}
11 changes: 5 additions & 6 deletions src/value_conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class PointerWrapper {
}
};

class ValueConversion {
public:
namespace ValueConversion {
template <class DUCKDB_NATIVE_TYPE>
static SEXP ToR(DUCKDB_NATIVE_TYPE val) {
//static_assert(false, "Unimplemented value conversion to R");
Expand Down Expand Up @@ -76,7 +75,7 @@ class ValueConversion {
}

template <>
SEXP ToR(duckdb_logical_type val) {
SEXP ToR(duckdb_logical_type val) {
// TOOD reduce code replication here
auto res = PointerWrapper<duckdb_vector , "duckdb_logical_type">::Allocate();
*(duckdb_logical_type*)R_ExternalPtrAddr(res) = val;
Expand All @@ -92,7 +91,7 @@ SEXP ToR(duckdb_logical_type val) {
}

template <>
SEXP ToR(void *val) {
SEXP ToR(void *val) {
auto res = PointerWrapper<void* , "duckdb_void_ptr">::Allocate();
R_SetExternalPtrAddr(res, val);
return res;
Expand Down Expand Up @@ -239,5 +238,5 @@ SEXP ToR(void *val) {
}


};
} // namespace duckdb_node
} // namespace ValueConversion
} // namespace duckdb_r

0 comments on commit e797c53

Please sign in to comment.