|
36 | 36 | #endif |
37 | 37 |
|
38 | 38 | #ifndef VOID_END_RCPP |
39 | | -// longer form with Rcpp::internal::LongjumpException first, alternate below #else |
40 | | -#if defined(RCPP_USE_UNWIND_PROTECT) |
| 39 | +#define VOID_END_RCPP \ |
41 | 40 | } \ |
42 | 41 | catch( Rcpp::internal::InterruptedException &__ex__) { \ |
43 | 42 | rcpp_output_type = 1 ; \ |
|
67 | 66 | SEXP expr = PROTECT( Rf_lang2( stop_sym , rcpp_output_condition ) ) ; \ |
68 | 67 | Rf_eval( expr, R_GlobalEnv ) ; \ |
69 | 68 | } |
70 | | -#else |
71 | | -#define VOID_END_RCPP \ |
72 | | - } \ |
73 | | - catch( Rcpp::internal::InterruptedException &__ex__) { \ |
74 | | - rcpp_output_type = 1 ; \ |
75 | | - } \ |
76 | | - catch(Rcpp::exception& __ex__) { \ |
77 | | - rcpp_output_type = 2 ; \ |
78 | | - rcpp_output_condition = PROTECT(rcpp_exception_to_r_condition(__ex__)) ; \ |
79 | | - } \ |
80 | | - catch( std::exception& __ex__ ){ \ |
81 | | - rcpp_output_type = 2 ; \ |
82 | | - rcpp_output_condition = PROTECT(exception_to_r_condition(__ex__)) ; \ |
83 | | - } \ |
84 | | - catch( ... ){ \ |
85 | | - rcpp_output_type = 2 ; \ |
86 | | - rcpp_output_condition = PROTECT(string_to_try_error("c++ exception (unknown reason)")) ; \ |
87 | | - } \ |
88 | | - if( rcpp_output_type == 1 ){ \ |
89 | | - Rf_onintr() ; \ |
90 | | - } \ |
91 | | - if( rcpp_output_type == 2 ){ \ |
92 | | - SEXP stop_sym = Rf_install( "stop" ) ; \ |
93 | | - SEXP expr = PROTECT( Rf_lang2( stop_sym , rcpp_output_condition ) ) ; \ |
94 | | - Rf_eval( expr, R_GlobalEnv ) ; \ |
95 | | - } |
96 | | -#endif |
97 | 69 | #endif |
98 | 70 |
|
99 | 71 | #ifndef END_RCPP |
100 | 72 | #define END_RCPP VOID_END_RCPP return R_NilValue; |
101 | 73 | #endif |
102 | 74 |
|
103 | 75 | #ifndef END_RCPP_RETURN_ERROR |
104 | | -// longer form with Rcpp::internal::LongjumpException first, alternate below #else |
105 | | -#if defined(RCPP_USE_UNWIND_PROTECT) |
106 | 76 | #define END_RCPP_RETURN_ERROR \ |
107 | 77 | } \ |
108 | 78 | catch (Rcpp::internal::InterruptedException &__ex__) { \ |
|
119 | 89 | return string_to_try_error("c++ exception (unknown reason)"); \ |
120 | 90 | } \ |
121 | 91 | return R_NilValue; |
122 | | -#else |
123 | | -#define END_RCPP_RETURN_ERROR \ |
124 | | - } \ |
125 | | - catch (Rcpp::internal::InterruptedException &__ex__) { \ |
126 | | - return Rcpp::internal::interruptedError(); \ |
127 | | - } \ |
128 | | - catch (std::exception &__ex__) { \ |
129 | | - return exception_to_try_error(__ex__); \ |
130 | | - } \ |
131 | | - catch (...) { \ |
132 | | - return string_to_try_error("c++ exception (unknown reason)"); \ |
133 | | - } \ |
134 | | - return R_NilValue; |
135 | | -#endif |
136 | 92 | #endif |
137 | 93 |
|
138 | 94 | #define Rcpp_error(MESSAGE) throw Rcpp::exception(MESSAGE, __FILE__, __LINE__) |
|
0 commit comments