The R Project SVN R-packages

Rev

Rev 8508 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8508 Rev 8513
Line 1... Line 1...
1
#include "JSON_parser.h"
1
#include "JSON_parser.h"
2
 
2
 
3
#include <Rinternals.h>
3
#include <Rinternals.h>
4
#include <Rdefines.h>
4
#include <Rdefines.h>
-
 
5
#include <Rversion.h>
5
 
6
 
6
#include "ConvertUTF.h"
7
#include "ConvertUTF.h"
7
 
8
 
8
#include <stdlib.h>
9
#include <stdlib.h>
9
 
10
 
Line 68... Line 69...
68
	    break;
69
	    break;
69
	case REALSXP:
70
	case REALSXP:
70
	    ptr = REAL(tmp);
71
	    ptr = REAL(tmp);
71
	    break;
72
	    break;
72
	case VECSXP:
73
	case VECSXP:
-
 
74
#if R_VERSION >= R_Version(4,5,0)
73
	    ptr = (void *) VECTOR_PTR_RO(tmp);
75
 	    ptr = (void *) VECTOR_PTR_RO(tmp);
-
 
76
#else
-
 
77
	    ptr = (void *) VECTOR_PTR(tmp);
-
 
78
#endif
74
	    break;
79
	    break;
75
	default:
80
	default:
76
	    ptr = NULL;
81
	    ptr = NULL;
77
	}
82
	}
78
	conf.callback = (JSON_parser_callback) R_ExternalPtrAddr(VECTOR_ELT(data, 0));
83
	conf.callback = (JSON_parser_callback) R_ExternalPtrAddr(VECTOR_ELT(data, 0));