Rcpp Version 1.1.2
Loading...
Searching...
No Matches
headers.h
Go to the documentation of this file.
1// headers.h: Rcpp R/C++ interface class library -- R headers
2//
3// Copyright (C) 2008 - 2009 Dirk Eddelbuettel
4// Copyright (C) 2009 - 2024 Dirk Eddelbuettel and Romain Francois
5// Copyright (C) 2025 - Dirk Eddelbuettel, Romain Francois and IƱaki Ucar
6//
7// This file is part of Rcpp.
8//
9// Rcpp is free software: you can redistribute it and/or modify it
10// under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 2 of the License, or
12// (at your option) any later version.
13//
14// Rcpp is distributed in the hope that it will be useful, but
15// WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
21
22#ifndef RCPP__R__HEADERS__H
23#define RCPP__R__HEADERS__H
24
25// include R headers, but set R_NO_REMAP and access everything via Rf_ prefixes
26#ifndef MAXELTSIZE
27 #define MAXELTSIZE 8192
28#endif
29#ifndef R_NO_REMAP
30 #define R_NO_REMAP
31#endif
32
33// define strict headers for R to not clash on ERROR, MESSGAGE, etc
34#ifndef RCPP_NO_STRICT_R_HEADERS
35# ifndef STRICT_R_HEADERS
36# define STRICT_R_HEADERS
37# endif
38#endif
39
40// no rtti implies no modules
41#ifdef RCPP_NO_RTTI
42# ifndef RCPP_NO_MODULES
43# define RCPP_NO_MODULES
44# endif
45#endif
46
47// prevent some macro pollution when including R headers
48// in particular, on Linux, gcc 'leaks' the 'major',
49// 'minor' and 'makedev' macros on Linux; we prevent
50// letting those leak in after including any R headers
51
52#ifdef major
53# define RCPP_HAS_MAJOR_MACRO
54# pragma push_macro("major")
55#endif
56
57#ifdef minor
58# define RCPP_HAS_MINOR_MACRO
59# pragma push_macro("minor")
60#endif
61
62#ifdef makedev
63# define RCPP_HAS_MAKEDEV_MACRO
64# pragma push_macro("makedev")
65#endif
66
68#include <Rcpp/config.h>
69#include <Rcpp/macros/macros.h>
70
71#include <R.h>
72#include <Rinternals.h>
73#include <R_ext/Complex.h>
74#include <R_ext/Parse.h>
75#include <R_ext/Rdynload.h>
76#include <R_ext/Visibility.h>
77#include <Rversion.h>
78
79/* Ensure NORET defined (normally provided by R headers with R >= 3.2.0) */
80#ifndef NORET
81# if defined(__GNUC__) && __GNUC__ >= 3
82# define NORET __attribute__((noreturn))
83# else
84# define NORET
85# endif
86#endif
87
88#undef major
89#undef minor
90#undef makedev
91
92#ifdef RCPP_HAS_MAJOR_MACRO
93# pragma pop_macro("major")
94#endif
95
96#ifdef RCPP_HAS_MINOR_MACRO
97# pragma pop_macro("minor")
98#endif
99
100#ifdef RCPP_HAS_MAKEDEV_MACRO
101# pragma pop_macro("makedev")
102#endif
103
104#endif /* RCPP__R__HEADERS__H */