|
20 | 20 | #ifndef RCPP__CHECK__R__HEADERS__H |
21 | 21 | #define RCPP__CHECK__R__HEADERS__H |
22 | 22 |
|
23 | | -#if defined(R_R_H) & defined(USING_R) |
24 | | -#pragma message "R.h has been included before any Rcpp headers. This can lead to hard-to-debug errors, and is generally not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
25 | | -#endif |
| 23 | +// Allow an escape hatch |
| 24 | +#if !defined(RCPP_NO_R_HEADERS_CHECK) |
26 | 25 |
|
27 | | -#if defined(RINTERFACE_H_) |
28 | | -#pragma message "Rinterface.h has been included before any Rcpp headers. This can lead to hard-to-debug errors, and is not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
29 | | -#endif |
| 26 | + #if defined(R_R_H) & defined(USING_R) |
| 27 | + #pragma message "R.h has been included before any Rcpp headers. This can lead to hard-to-debug errors, and is generally not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
| 28 | + #endif |
30 | 29 |
|
31 | | -#if defined(R_INTERNALS_H_) |
32 | | -#pragma message "Rinternals.h has been included before any Rcpp headers. This can lead to hard-to-debug errors, and is generally not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
33 | | -#endif |
| 30 | + #if defined(RINTERFACE_H_) |
| 31 | + #pragma message "Rinterface.h has been included before any Rcpp headers. This can lead to hard-to-debug errors, and is not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
| 32 | + #endif |
34 | 33 |
|
35 | | -#if defined(R_DEFINES_H_) |
36 | | -#pragma message "Rdefines.h has been included before any Rcpp headers. This can lead to hard-to-debug errors, and is generally not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
37 | | -#endif |
| 34 | + #if defined(R_INTERNALS_H_) |
| 35 | + #pragma message "Rinternals.h has been included before any Rcpp headers. This can lead to hard-to-debug errors, and is generally not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
| 36 | + #endif |
38 | 37 |
|
39 | | -#endif |
| 38 | + #if defined(R_DEFINES_H_) |
| 39 | + #pragma message "Rdefines.h has been included before any Rcpp headers. This can lead to hard-to-debug errors, and is generally not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
| 40 | + #endif |
| 41 | + |
| 42 | +#endif // escape hatch '!defined(RCPP_NO_R_HEADERS_CHECK)' |
| 43 | + |
| 44 | +#endif // header guard |
0 commit comments