Skip to content

Commit

Permalink
removed system requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
dcooley committed May 20, 2024
1 parent fab938a commit 3668481
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: jsonify
Type: Package
Title: Convert Between 'R' Objects and Javascript Object Notation (JSON)
Version: 1.2.3
Date: 2024-01-18
Date: 2024-05-21
Authors@R: c(
person("David", "Cooley", ,"[email protected]", role = c("aut", "cre")),
person("Chris", "Muir", role = "ctb"),
Expand All @@ -11,8 +11,7 @@ Authors@R: c(
Description: Conversions between 'R' objects and Javascript Object Notation (JSON) using
the 'rapidjsonr' library <https://CRAN.R-project.org/package=rapidjsonr>.
License: MIT + file LICENSE
Depends: R (>= 3.3.0)
SystemRequirements: C++11
Depends: R (>= 4.0.0)
Imports:
Rcpp (>= 1.0.10)
LinkingTo:
Expand All @@ -28,3 +27,5 @@ Encoding: UTF-8
URL: https://symbolixau.github.io/jsonify/, https://github.com/SymbolixAU/jsonify
BugReports: https://github.com/SymbolixAU/jsonify/issues
VignetteBuilder: knitr
remotes:
https://github.com/SymbolixAU/rapidjsonr
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## v1.2.3

* removed C++11 System requirement
* patch for handling Int64 [issue 81](https://github.com/symbolixAU/jsonify/issues/81)

## v1.2.2
Expand Down
16 changes: 8 additions & 8 deletions inst/include/jsonify/from_json/from_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define R_JSONIFY_FROM_JSON_H

#include <Rcpp.h>

#include "from_json_utils.hpp"
#include "simplify/simplify.hpp"

Expand Down Expand Up @@ -77,18 +76,19 @@ namespace from_json {
Rcpp::CharacterVector names( json_length );
R_xlen_t i = 0;

// removed in 1.2.3
// https://github.com/Tencent/rapidjson/issues/162#issuecomment-341824061
#if __cplusplus >= 201703L
for ( const auto& [key, value] : json.GetObject() ) {
out[ i ] = parse_json( value, simplify, fill_na );
names[ i++ ] = std::string( key );
}
#else
// #if __cplusplus >= 201703L
// for ( const auto& [key, value] : json.GetObject() ) {
// out[ i ] = parse_json( value, simplify, fill_na );
// names[ i++ ] = std::string( key );
// }
// #else
for ( const auto& key_value : json.GetObject() ) {
out[ i ] = parse_json( key_value.value, simplify, fill_na );
names[ i++ ] = std::string( key_value.name.GetString() );
}
#endif
// #endif
out.attr("names") = names;
return out;
}
Expand Down
2 changes: 0 additions & 2 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
CXX_STD = CXX11

PKG_CXXFLAGS = -I../inst/include/
PKG_CPPFLAGS=-DSTRICT_R_HEADERS
2 changes: 0 additions & 2 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
CXX_STD = CXX11

PKG_CXXFLAGS = -I../inst/include/
PKG_CPPFLAGS=-DSTRICT_R_HEADERS
2 changes: 1 addition & 1 deletion tests/testthat/test-from_json.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ test_that("scalar values handled properly", {

test_that("Int64 treated as double", {
json_str <- '{"value" : 5500000000}'
expect_equal(from_json(json_obj)$value, 5.5e+09)
expect_equal(from_json(json_str)$value, 5.5e+09)
})

test_that("vector / array values handled properly", {
Expand Down

0 comments on commit 3668481

Please sign in to comment.