Writing R extensions says:

Most R header files can be included within C++ programs but they should
not be included within an extern "C" block (as they include system headers).

This patch moves the Rdefines.h and Rversion.h outside the extern block.
This commit is contained in:
Richard Beare 2016-08-05 15:43:50 +10:00
commit c334efd36b

View file

@ -1,15 +1,4 @@
#ifdef __cplusplus
#include <exception>
extern "C" {
#endif
/* for raw pointer */
#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_R_ConvertPtr(obj, pptr, type, flags)
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_R_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewPointerObj(ptr, type, flags) SWIG_R_NewPointerObj(ptr, type, flags)
/* Remove global namespace pollution */
#if !defined(SWIG_NO_R_NO_REMAP)
# define R_NO_REMAP
@ -20,6 +9,17 @@ extern "C" {
#include <Rdefines.h>
#include <Rversion.h>
#ifdef __cplusplus
#include <exception>
extern "C" {
#endif
/* for raw pointer */
#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_R_ConvertPtr(obj, pptr, type, flags)
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_R_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewPointerObj(ptr, type, flags) SWIG_R_NewPointerObj(ptr, type, flags)
#include <stdlib.h>
#include <assert.h>