|
23 | 23 | #define Rcpp_macros_macros_h
|
24 | 24 |
|
25 | 25 | #define RCPP_DECORATE(__FUN__) __FUN__##__rcpp__wrapper__
|
26 |
| -#define RCPP_GET_NAMES(x) Rf_getAttrib(x, R_NamesSymbol) |
27 |
| -#define RCPP_GET_CLASS(x) Rf_getAttrib(x, R_ClassSymbol) |
| 26 | +#define RCPP_GET_NAMES(x) Rf_getAttrib(x, R_NamesSymbol) |
| 27 | +#define RCPP_GET_CLASS(x) Rf_getAttrib(x, R_ClassSymbol) |
28 | 28 |
|
29 | 29 | #ifndef BEGIN_RCPP
|
30 |
| -#define BEGIN_RCPP try{ |
| 30 | +#define BEGIN_RCPP try { |
31 | 31 | #endif
|
32 | 32 |
|
33 | 33 | #ifndef VOID_END_RCPP
|
34 |
| -#define VOID_END_RCPP } catch( Rcpp::internal::InterruptedException& __ex__ ) { Rf_onintr(); } catch( std::exception& __ex__ ){ forward_exception_to_r( __ex__ ) ; } catch(...){ ::Rf_error( "c++ exception (unknown reason)" ) ; } |
| 34 | +#define VOID_END_RCPP \ |
| 35 | + } \ |
| 36 | + catch (Rcpp::internal::InterruptedException &__ex__) { \ |
| 37 | + Rf_onintr(); \ |
| 38 | + } \ |
| 39 | + catch (std::exception &__ex__) { \ |
| 40 | + forward_exception_to_r(__ex__); \ |
| 41 | + } \ |
| 42 | + catch (...) { \ |
| 43 | + ::Rf_error("c++ exception (unknown reason)"); \ |
| 44 | + } |
35 | 45 | #endif
|
36 | 46 |
|
37 | 47 | #ifndef END_RCPP
|
38 | 48 | #define END_RCPP VOID_END_RCPP return R_NilValue;
|
39 | 49 | #endif
|
40 | 50 |
|
41 | 51 | #ifndef END_RCPP_RETURN_ERROR
|
42 |
| -#define END_RCPP_RETURN_ERROR } catch( Rcpp::internal::InterruptedException& __ex__ ) { return Rcpp::internal::interruptedError(); } catch( std::exception& __ex__ ){ return exception_to_try_error( __ex__ ) ; } catch(...){ return string_to_try_error( "c++ exception (unknown reason)" ) ; } return R_NilValue; |
| 52 | +#define END_RCPP_RETURN_ERROR \ |
| 53 | + } \ |
| 54 | + catch (Rcpp::internal::InterruptedException &__ex__) { \ |
| 55 | + return Rcpp::internal::interruptedError(); \ |
| 56 | + } \ |
| 57 | + catch (std::exception &__ex__) { \ |
| 58 | + return exception_to_try_error(__ex__); \ |
| 59 | + } \ |
| 60 | + catch (...) { \ |
| 61 | + return string_to_try_error("c++ exception (unknown reason)"); \ |
| 62 | + } \ |
| 63 | + return R_NilValue; |
43 | 64 | #endif
|
44 | 65 |
|
45 |
| -#define Rcpp_error(MESSAGE) throw Rcpp::exception( MESSAGE, __FILE__, __LINE__ ) |
| 66 | +#define Rcpp_error(MESSAGE) throw Rcpp::exception(MESSAGE, __FILE__, __LINE__) |
46 | 67 |
|
47 | 68 | #include <Rcpp/macros/debug.h>
|
48 | 69 | #include <Rcpp/macros/unroll.h>
|
|
0 commit comments