File tree Expand file tree Collapse file tree 3 files changed +16
-13
lines changed
Expand file tree Collapse file tree 3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,11 @@ namespace Rcpp{
2626 SEXP Rcpp_eval (SEXP expr, SEXP env = R_GlobalEnv) ;
2727 const char * type2name (SEXP x) ;
2828 std::string demangle ( const std::string& name) ;
29- unsigned long enterRNGScope ();
30- unsigned long exitRNGScope () ;
29+
30+ namespace internal {
31+ unsigned long enterRNGScope ();
32+ unsigned long exitRNGScope () ;
33+ }
3134 SEXP get_Rcpp_namespace () ;
3235 int * get_cache ( int n ) ;
3336 SEXP rcpp_get_stack_trace () ;
@@ -82,11 +85,13 @@ namespace Rcpp {
8285 static Fun fun = GET_CALLABLE (" demangle" ) ;
8386 return fun (name) ;
8487 }
85-
86- inline unsigned long enterRNGScope (){
87- typedef unsigned long (*Fun)(void ) ;
88- static Fun fun = GET_CALLABLE (" enterRNGScope" ) ;
89- return fun () ;
88+
89+ namespace internal {
90+ inline unsigned long enterRNGScope (){
91+ typedef unsigned long (*Fun)(void ) ;
92+ static Fun fun = GET_CALLABLE (" enterRNGScope" ) ;
93+ return fun () ;
94+ }
9095 }
9196
9297 inline unsigned long exitRNGScope (){
Original file line number Diff line number Diff line change 2323#define Rcpp__stats__random_random_h
2424
2525namespace Rcpp {
26- namespace internal {
27- void enterRNGScope ();
28- void exitRNGScope ();
29- }
3026
3127class RNGScope {
3228public:
Original file line number Diff line number Diff line change @@ -61,15 +61,17 @@ namespace Rcpp {
6161 }
6262
6363 // [[Rcpp::register]]
64- void enterRNGScope () {
64+ unsigned long enterRNGScope () {
6565 if (RNGScopeCounter == 0 ) GetRNGstate ();
6666 RNGScopeCounter++;
67+ return RNGScopeCounter ;
6768 }
6869
6970 // [[Rcpp::register]]
70- void exitRNGScope () {
71+ unsigned long exitRNGScope () {
7172 RNGScopeCounter--;
7273 if (RNGScopeCounter == 0 ) PutRNGstate ();
74+ return RNGScopeCounter ;
7375 }
7476
7577 // [[Rcpp::register]]
You can’t perform that action at this time.
0 commit comments