usamin 7.7.10 → 7.7.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bcf99c5b8f00f296106cfb0799a5d241dbf1cc8053e74d252b4e1d00692d760d
4
- data.tar.gz: 48c92bfee2edd6f7e39032dbddcc94f0b9343a1fde13d561f99aa50c231bac11
3
+ metadata.gz: 5c1850442411d90d31a98e9d3286b773852a1e855ba32227b1d266ea2ae2581f
4
+ data.tar.gz: 4382e4499525e5aa163e023feb62f4e839bc98dd3540a11112ee6b3334d632c1
5
5
  SHA512:
6
- metadata.gz: 5ec0a132cc068d9cea796e407babcf04dae6323bc45a696c80f49610c78d71e0a218ae0ab20cc4e32a50eda1616a907c8f4c116dae7086eee6bf0378a5efd32d
7
- data.tar.gz: 958dfa0b6ffe3bd031ba8ae6b9b83a5542b4a5bc69579677391788a2424c733069871a5e4f5c067eb6f99c6a770a8d15ca1476f52c5a29211cb3069231cf760d
6
+ metadata.gz: 27d1e300cb0242087202b903ef425ff25d81b1249834111f1302d060e7991e9e665f34f2674a8da5f90647bc9448417141925cd6fad06bdd5783f79fc59bea0f
7
+ data.tar.gz: 0133a944f187fed3deb2f295fd2e18b9386d52a1f87f3873f58ab37b530de591812f29c422558c35e180b65ebb73ff94d4ca9669dc027c6f47716018538e0004
@@ -4,6 +4,7 @@ require 'mkmf'
4
4
 
5
5
  RbConfig::MAKEFILE_CONFIG['CXX'] = ENV['CXX'] if ENV['CXX']
6
6
  have_library('stdc++')
7
+ have_library('m')
7
8
  dir_config('rapidjson')
8
9
  append_cppflags('-O3')
9
10
  append_cppflags('-Wall')
@@ -20,4 +21,7 @@ if checking_for('whether -march=native is accepted as CPPFLAGS'){try_cppflags('-
20
21
  end
21
22
 
22
23
  $CPPFLAGS << ' -std=c++11'
24
+
25
+ $CPPFLAGS << ' -DRAPIDJSON_IS_HEAD' if arg_config('--rapidjson-is-head')
26
+
23
27
  create_makefile('usamin/usamin')
@@ -1,3 +1,4 @@
1
+ #include "rb270_fix.hpp"
1
2
  #include <rapidjson/prettywriter.h>
2
3
  #include <rapidjson/writer.h>
3
4
  #include <ruby.h>
@@ -6,6 +7,8 @@
6
7
  #include "rb_usamin_value.hpp"
7
8
  #include "rubynized_rapidjson.hpp"
8
9
 
10
+ #define WRITER_CONFIGS rapidjson::UTF8<>, rapidjson::UTF8<>, RubyCrtAllocator, rapidjson::kWriteNanAndInfFlag
11
+
9
12
  template <class Writer>
10
13
  static inline void write_hash(Writer &, const VALUE);
11
14
  template <class Writer>
@@ -152,7 +155,7 @@ static inline void write_usamin(Writer &writer, const VALUE self) {
152
155
  */
153
156
  VALUE w_generate(const VALUE, const VALUE value) {
154
157
  rapidjson::StringBuffer buf;
155
- rapidjson::Writer<rapidjson::StringBuffer> writer(buf);
158
+ rapidjson::Writer<rapidjson::StringBuffer, WRITER_CONFIGS> writer(buf);
156
159
  write(writer, value);
157
160
  return new_utf8_str(buf.GetString(), buf.GetSize());
158
161
  }
@@ -174,7 +177,11 @@ VALUE w_pretty_generate(const int argc, const VALUE *argv, const VALUE) {
174
177
  VALUE value, options;
175
178
  rb_scan_args(argc, argv, "1:", &value, &options);
176
179
  rapidjson::StringBuffer buf;
180
+ #if RAPIDJSON_VERSION_CODE(RAPIDJSON_MAJOR_VERSION, RAPIDJSON_MINOR_VERSION, RAPIDJSON_PATCH_VERSION) > RAPIDJSON_VERSION_CODE(1, 1, 0) || defined(RAPIDJSON_IS_HEAD)
181
+ rapidjson::PrettyWriter<rapidjson::StringBuffer, WRITER_CONFIGS> writer(buf);
182
+ #else
177
183
  rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(buf);
184
+ #endif
178
185
 
179
186
  char indent_char = ' ';
180
187
  unsigned int indent_count = 2;
@@ -1,3 +1,4 @@
1
+ #include "rb270_fix.hpp"
1
2
  #include "default_parse_flags.hpp"
2
3
  #include "parser.hpp"
3
4
  #include <rapidjson/reader.h>
@@ -0,0 +1,16 @@
1
+ #ifndef RB270_FIX_HPP
2
+ #define RB270_FIX_HPP
3
+
4
+ #include <cstring>
5
+ #include <ruby/version.h>
6
+
7
+ #if RUBY_API_VERSION_CODE >= 20700 && defined(__GLIBC__)
8
+
9
+ namespace std {
10
+ static inline void *ruby_nonempty_memcpy(void *dest, const void *src, size_t n) {
11
+ return (n ? memcpy(dest, src, n) : dest);
12
+ }
13
+ } // namespace std
14
+ #endif
15
+
16
+ #endif
@@ -1,3 +1,4 @@
1
+ #include "rb270_fix.hpp"
1
2
  #include <rapidjson/document.h>
2
3
  #include <ruby.h>
3
4
  #include "usamin_value.hpp"
@@ -1,3 +1,4 @@
1
+ #include "rb270_fix.hpp"
1
2
  #include <rapidjson/document.h>
2
3
  #include <ruby.h>
3
4
  #include <ruby/version.h>
@@ -1,3 +1,4 @@
1
+ #include "rb270_fix.hpp"
1
2
  #include "default_parse_flags.hpp"
2
3
  #include <rapidjson/error/en.h>
3
4
  #include <rapidjson/reader.h>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Usamin
4
- VERSION = '7.7.10'
4
+ VERSION = '7.7.11'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usamin
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.7.10
4
+ version: 7.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ishotihadus
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-25 00:00:00.000000000 Z
11
+ date: 2020-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,6 +89,7 @@ files:
89
89
  - ext/usamin/parser.cpp
90
90
  - ext/usamin/parser.hpp
91
91
  - ext/usamin/parser_helper.hpp
92
+ - ext/usamin/rb270_fix.hpp
92
93
  - ext/usamin/rb_common.cpp
93
94
  - ext/usamin/rb_common.hpp
94
95
  - ext/usamin/rb_usamin_array.cpp
@@ -110,7 +111,7 @@ homepage: https://github.com/Ishotihadus/usamin
110
111
  licenses:
111
112
  - MIT
112
113
  metadata: {}
113
- post_install_message:
114
+ post_install_message:
114
115
  rdoc_options: []
115
116
  require_paths:
116
117
  - lib
@@ -126,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
127
  version: '0'
127
128
  requirements: []
128
129
  rubygems_version: 3.1.2
129
- signing_key:
130
+ signing_key:
130
131
  specification_version: 4
131
132
  summary: A RapidJSON Wrapper for Ruby
132
133
  test_files: []