diff --git a/src/include/Rinternals.h b/src/include/Rinternals.h index 517376b19aa..05dd434a2c7 100644 --- a/src/include/Rinternals.h +++ b/src/include/Rinternals.h @@ -34,7 +34,6 @@ # include # include # include -extern "C" { #else # include # include /* for INT_MAX */ @@ -52,18 +51,23 @@ extern "C" { #include -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 #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