Skip to content

Commit 3184e72

Browse files
committed
Now builds appropriately with RCPP_NO_SUGAR defined.
1 parent 88ebc36 commit 3184e72

File tree

4 files changed

+18
-6
lines changed

4 files changed

+18
-6
lines changed

inst/include/Rcpp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666

6767
#include <Rcpp/Nullable.h>
6868

69+
#include <Rcpp/RNGScope.h>
70+
6971
#ifndef RCPP_NO_SUGAR
7072
#include <Rcpp/sugar/sugar.h>
7173
#include <Rcpp/stats/stats.h>

inst/include/Rcpp/RNGScope.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#ifndef Rcpp__RNGScope_h
2+
#define Rcpp__RNGScope_h
3+
4+
namespace Rcpp {
5+
6+
class RNGScope{
7+
public:
8+
RNGScope(){ internal::enterRNGScope(); }
9+
~RNGScope(){ internal::exitRNGScope(); }
10+
};
11+
12+
} // namespace Rcpp
13+
14+
#endif

inst/include/Rcpp/stats/random/random.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424

2525
namespace Rcpp{
2626

27-
class RNGScope{
28-
public:
29-
RNGScope(){ internal::enterRNGScope(); }
30-
~RNGScope(){ internal::exitRNGScope(); }
31-
};
32-
3327
template <typename T>
3428
class Generator : public RNGScope {
3529
public:

inst/include/Rcpp/vector/Matrix.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ inline std::ostream &operator<<(std::ostream & s, const Matrix<REALSXP, StorageP
247247
return s;
248248
}
249249

250+
#ifndef RCPP_NO_SUGAR
250251
#define RCPP_GENERATE_MATRIX_SCALAR_OPERATOR(__OPERATOR__) \
251252
template <int RTYPE, template <class> class StoragePolicy, typename T > \
252253
inline typename traits::enable_if< traits::is_convertible< typename traits::remove_const_and_reference< T >::type, \
@@ -281,6 +282,7 @@ RCPP_GENERATE_SCALAR_MATRIX_OPERATOR(*)
281282
RCPP_GENERATE_SCALAR_MATRIX_OPERATOR(/)
282283

283284
#undef RCPP_GENERATE_SCALAR_MATRIX_OPERATOR
285+
#endif
284286

285287
template<template <class> class StoragePolicy >
286288
inline std::ostream &operator<<(std::ostream & s, const Matrix<INTSXP, StoragePolicy> & rhs) {

0 commit comments

Comments
 (0)