Skip to content

Commit

Permalink
Override hnswlib's std::cerr to avoid CRAN check warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Jan 6, 2024
1 parent 2335af9 commit f792bee
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: BiocNeighbors
Version: 1.20.1
Date: 2023-11-29
Version: 1.20.2
Date: 2024-01-05
Title: Nearest Neighbor Detection for Bioconductor Packages
Authors@R: c(person("Aaron", "Lun", role=c("aut", "cre", "cph"),
email="[email protected]"))
Expand Down
5 changes: 5 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// annoy_version
Rcpp::IntegerVector annoy_version();
RcppExport SEXP _BiocNeighbors_annoy_version() {
Expand Down
3 changes: 3 additions & 0 deletions src/hnsw.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
// Avoid discrepancies with AVX.
#define NO_MANUAL_VECTORIZATION

// Avoid CRAN problems with std::cerr.
#define HNSWLIB_ERR_OVERRIDE Rcpp::Rcerr

// Avoid compilation problems on Windows.
#define STRICT_R_HEADERS

Expand Down

0 comments on commit f792bee

Please sign in to comment.