Skip to content

Commit

Permalink
Set extern "C" { after all R headers have been included
Browse files Browse the repository at this point in the history
  • Loading branch information
DavisVaughan committed Aug 26, 2024
1 parent e5f99af commit a27a11e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/include/Rinternals.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
# include <cstdio>
# include <climits>
# include <cstddef>
extern "C" {
#else
# include <stdio.h>
# include <limits.h> /* for INT_MAX */
Expand All @@ -52,18 +51,23 @@ extern "C" {

#include <R_ext/libextern.h>

typedef unsigned char Rbyte;

/* type for length of (standard, not long) vectors etc */
typedef int R_len_t;
#define R_LEN_T_MAX INT_MAX

/* both config.h and Rconfig.h set SIZEOF_SIZE_T, but Rconfig.h is
skipped if config.h has already been included. */
#ifndef R_CONFIG_H
# include <Rconfig.h>
#endif

/* after all R headers */
#ifdef __cplusplus
extern "C" {
#endif

typedef unsigned char Rbyte;

/* type for length of (standard, not long) vectors etc */
typedef int R_len_t;
#define R_LEN_T_MAX INT_MAX

#if ( SIZEOF_SIZE_T > 4 )
# define LONG_VECTOR_SUPPORT
#endif
Expand Down

0 comments on commit a27a11e

Please sign in to comment.