Skip to content

Commit 29980a7

Browse files
committed
add explicit workaround for h5
1 parent 10a02e2 commit 29980a7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

inst/include/Rcpp/String.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,16 @@ namespace Rcpp {
365365

366366

367367
inline SEXP get_sexp_impl() const {
368+
369+
// workaround for h5 package (currently deprecated so updates
370+
// to CRAN may not be timely)
371+
#ifdef __H5Cpp_H
372+
return Rf_mkCharCE(buffer.c_str(), enc);
373+
#else
368374
if (buffer.find('\0') != std::string::npos)
369375
throw embedded_nul_in_string();
370376
return Rf_mkCharLenCE(buffer.c_str(), buffer.size(), enc);
377+
#endif
371378
}
372379

373380
inline SEXP get_sexp() const {

0 commit comments

Comments
 (0)