From e797c53269ecf86adf139454a8d8e724859d0f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Tue, 25 Jun 2024 20:25:34 +0200 Subject: [PATCH] Fix gcc compatibility --- src/duckdb_r.cpp | 4 +++- src/value_conversion.h | 11 +++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/duckdb_r.cpp b/src/duckdb_r.cpp index 3432704..6eaf492 100644 --- a/src/duckdb_r.cpp +++ b/src/duckdb_r.cpp @@ -2,6 +2,8 @@ #include "Rdefines.h" #include +#include + #ifdef _WIN32 @@ -81,4 +83,4 @@ void R_init_duckdbneo(DllInfo *dll) { R_useDynamicSymbols(dll, FALSE); R_forceSymbols(dll, TRUE); } -} \ No newline at end of file +} diff --git a/src/value_conversion.h b/src/value_conversion.h index 7be96e4..0992b7d 100644 --- a/src/value_conversion.h +++ b/src/value_conversion.h @@ -41,8 +41,7 @@ class PointerWrapper { } }; -class ValueConversion { -public: +namespace ValueConversion { template static SEXP ToR(DUCKDB_NATIVE_TYPE val) { //static_assert(false, "Unimplemented value conversion to R"); @@ -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::Allocate(); *(duckdb_logical_type*)R_ExternalPtrAddr(res) = val; @@ -92,7 +91,7 @@ SEXP ToR(duckdb_logical_type val) { } template <> -SEXP ToR(void *val) { + SEXP ToR(void *val) { auto res = PointerWrapper::Allocate(); R_SetExternalPtrAddr(res, val); return res; @@ -239,5 +238,5 @@ SEXP ToR(void *val) { } -}; -} // namespace duckdb_node \ No newline at end of file +} // namespace ValueConversion +} // namespace duckdb_r