vox-etf 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a6a2cc3e5abff452aed1b87b83f3c9906fa673cdac9251b92051492d7de0ff2
4
- data.tar.gz: 2caddaa1b5163345f676d9649c624e9ec2580e770d32dddecd2325800e9845d0
3
+ metadata.gz: c8d2deb457e60eb111c3f25ee95afcf9532e369ec4dff759908d48c92c93d3cf
4
+ data.tar.gz: d003df24854077a8b6192506f62db5888c417acaf35872b9ddd6bebf7c37f720
5
5
  SHA512:
6
- metadata.gz: 56ff3b112058ec393869a0532905bad5f27adcd533a7427cacea86ffdbae49b261ca4a258dc33683af52bf0bce0c44fb6554a08b11d99a6c2a1c3862deb1ae8c
7
- data.tar.gz: 96482eb0de9485c5938724b8d06d136028907ec99270a0bf46239d33b6313b1ad7207df021206099c11528f3dcbde8faeabdf0ba18f4cb007dad9061dc01f21c
6
+ metadata.gz: be499bd7ec49e3e1ee4945b808979a2a8bf331ac871f227a90a8ff77d28a87eddc32cea4f7e6e722d3d09d88a1a226c05d6b4760ef1ccf517b786fe9799c1429
7
+ data.tar.gz: 7bfa5417c8d0fbe5a2226fe2bb506af46cbb22d1736ef7b99029bec0074c35080b30e84450296ce23c0589cf6394349eca4f8e2376099cc60eccd9af796528c6
@@ -1,5 +1,6 @@
1
1
  #pragma once
2
2
  #include <zlib.h>
3
+ #include "./etf.hpp"
3
4
  #include "ruby.h"
4
5
  #include "erlpack/sysdep.h"
5
6
  #include "erlpack/constants.h"
@@ -360,6 +361,7 @@ namespace etf
360
361
 
361
362
  VALUE decode_compressed()
362
363
  {
364
+ #if HAVE_ZLIB_H
363
365
  const uint32_t decompressed_size = read32();
364
366
 
365
367
  unsigned long source_size = decompressed_size;
@@ -378,6 +380,10 @@ namespace etf
378
380
  VALUE value = decompressed.decode_term();
379
381
  free(out_buffer);
380
382
  return value;
383
+ #else
384
+ rb_raise(rb_eArgError, "vox-etf was compiled without zlib support can cannot decode the compressed term.");
385
+ return Qnil;
386
+ #endif
381
387
  }
382
388
  };
383
389
  } // namespace etf
@@ -1,6 +1,6 @@
1
1
  #include "erlpack/encoder.h"
2
2
  #include "erlpack/constants.h"
3
- #include "etf.hpp"
3
+ #include "./etf.hpp"
4
4
  #include "ruby.h"
5
5
 
6
6
  namespace etf
@@ -1,5 +1,6 @@
1
1
  #pragma once
2
2
 
3
+ #include "./extconf.h"
3
4
  #define ETF_VERSION 131
4
5
 
5
6
  VALUE decode(VALUE self, VALUE input);
@@ -3,11 +3,14 @@
3
3
  require('mkmf')
4
4
 
5
5
  find_header('ruby.h')
6
- find_header('zlib.h')
7
6
  find_header('stddef.h')
8
7
  find_header('stdlib.h')
9
8
  find_header('stdint.h')
10
9
  find_header('limits.h')
11
10
  find_header('string.h')
11
+ have_header('zlib.h')
12
+ have_library('z')
13
+
14
+ create_header
12
15
 
13
16
  create_makefile('vox/etf')
@@ -21,6 +21,6 @@ module Vox
21
21
  # end
22
22
 
23
23
  # Gem version
24
- VERSION = '0.1.7'
24
+ VERSION = '0.1.8'
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vox-etf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Carey