FIMS  v0.11.0
Loading...
Searching...
No Matches
rcpp_include.hpp
Go to the documentation of this file.
1
9#ifndef FIMS_INTERFACE_RCPP_RCPP_INCLUDE_HPP
10#define FIMS_INTERFACE_RCPP_RCPP_INCLUDE_HPP
11
12// Only the first inclusion of Rcpp in a translation unit sets its
13// configuration, so Rcpp must not be included before this header.
14#ifdef Rcpp_hpp
15#error "Include interface/rcpp/rcpp_include.hpp instead of <Rcpp.h>."
16#endif
17
18// Rcpp is included with NDEBUG defined so a failed type conversion raises an
19// R error instead of calling abort(). R defines NDEBUG for installed builds;
20// defining it here makes debug builds (e.g., devtools::load_all()) behave the
21// same. push_macro and pop_macro restore the build's NDEBUG afterward, and
22// <cassert> is included again so assert() in FIMS code follows that setting.
23#pragma push_macro("NDEBUG")
24#undef NDEBUG
26#define NDEBUG 1
28#include <Rcpp.h>
29#pragma pop_macro("NDEBUG")
30#include <cassert>
31
32#endif // FIMS_INTERFACE_RCPP_RCPP_INCLUDE_HPP