1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// R_xlen_t is defined as int on 32-bit platforms, and
// that confuses Rust. Keeping it always as ptrdiff_t works
// fine even on 32-bit.
/// <div rustbindgen replaces="R_xlen_t"></div>
typedef ptrdiff_t R_xlen_t_rust;
// Define this for R_CStackLimit
// #define HAVE_UINTPTR_T
// From r83513 (R 4.3), R defines the `NORET` macro differently depending on the
// C/C++ standard the compiler uses. It matters when the header is used in C/C++
// libraries, but all we want to do here is to make bindgen interpret `NOREP` to
// `!`. However, for some reason, bindgen doesn't handle other no-return
// attributes like `_Noreturn` (for C11) and `[[noreturn]]` (for C++ and C23),
// so we define it here.
// Currently, I'm adding these on as-needed basis
// but we may simply throw the whole lot in in the future.
extern uintptr_t R_CStackLimit; /* C stack limit */
// R 4.3 redefined `Rcomplex` to a union for compatibility with Fortran.
// But the old definition is compatible both the union version
// and the struct version.
// See: <https://github.com/extendr/extendr/issues/524>
/// <div rustbindgen replaces="Rcomplex"></div>
typedef struct
R_complex_impl;