|
| 1 | +// check_r_headers.h: Rcpp R/C++ interface class library -- R header check |
| 2 | +// |
| 3 | +// Copyright (C) 2025 - current Dirk Eddelbuettel |
| 4 | +// |
| 5 | +// This file is part of Rcpp. |
| 6 | +// |
| 7 | +// Rcpp is free software: you can redistribute it and/or modify it |
| 8 | +// under the terms of the GNU General Public License as published by |
| 9 | +// the Free Software Foundation, either version 2 of the License, or |
| 10 | +// (at your option) any later version. |
| 11 | +// |
| 12 | +// Rcpp is distributed in the hope that it will be useful, but |
| 13 | +// WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | +// GNU General Public License for more details. |
| 16 | +// |
| 17 | +// You should have received a copy of the GNU General Public License |
| 18 | +// along with Rcpp. If not, see <http://www.gnu.org/licenses/>. |
| 19 | + |
| 20 | +#ifndef RCPP__CHECK__R__HEADERS__H |
| 21 | +#define RCPP__CHECK__R__HEADERS__H |
| 22 | + |
| 23 | +// Allow an escape hatch |
| 24 | +#if !defined(RCPP_NO_R_HEADERS_CHECK) |
| 25 | + |
| 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 not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
| 28 | + #endif |
| 29 | + |
| 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 |
| 33 | + |
| 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 not necessary. See https://github.com/RcppCore/Rcpp/issues/1410" |
| 36 | + #endif |
| 37 | + |
| 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 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