Imported Upstream version 3.001.003
authorgregor herrmann <gregoa@debian.org>
Tue, 15 Jul 2014 14:21:23 +0000 (16:21 +0200)
committergregor herrmann <gregoa@debian.org>
Tue, 15 Jul 2014 14:21:23 +0000 (16:21 +0200)
META.json
META.yml
lib/Sereal/Encoder.pm
snappy/csnappy_internal_userspace.h
srl_common.h
t/lib/Sereal/TestSet.pm

index 6f4afa3503365670b0b0ce5756ddfed0cf57c34d..c40b1231c061cc6802dff8f1d23e6a70317e8f3d 100644 (file)
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
       "Steffen Mueller <smueller@cpan.org>, Yves Orton <yves@cpan.org>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 6.9, CPAN::Meta::Converter version 2.120351",
+   "generated_by" : "ExtUtils::MakeMaker version 6.9, CPAN::Meta::Converter version 2.141520",
    "license" : [
       "perl_5"
    ],
@@ -55,5 +55,5 @@
          "url" : "git://github.com/Sereal/Sereal.git"
       }
    },
-   "version" : "3.001_002"
+   "version" : "3.001_003"
 }
index 53288781ec78a85c76430c67b1f2a0a6686845ae..7923d7e3991e517d7652d1ae35d6639b92a935ab 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -3,33 +3,33 @@ abstract: 'Fast, compact, powerful binary serialization'
 author:
   - 'Steffen Mueller <smueller@cpan.org>, Yves Orton <yves@cpan.org>'
 build_requires:
-  Data::Dumper: 0
-  ExtUtils::ParseXS: 2.21
-  File::Find: 0
-  File::Path: 0
-  File::Spec: 0
-  Scalar::Util: 0
-  Sereal::Decoder: 3.00
-  Test::LongString: 0
-  Test::More: 0.88
-  Test::Warn: 0
+  Data::Dumper: '0'
+  ExtUtils::ParseXS: '2.21'
+  File::Find: '0'
+  File::Path: '0'
+  File::Spec: '0'
+  Scalar::Util: '0'
+  Sereal::Decoder: '3.00'
+  Test::LongString: '0'
+  Test::More: '0.88'
+  Test::Warn: '0'
 configure_requires:
-  ExtUtils::MakeMaker: 0
+  ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 6.9, CPAN::Meta::Converter version 2.120351'
+generated_by: 'ExtUtils::MakeMaker version 6.9, CPAN::Meta::Converter version 2.141520'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
+  version: '1.4'
 name: Sereal-Encoder
 no_index:
   directory:
     - t
     - inc
 requires:
-  XSLoader: 0
-  perl: 5.008
+  XSLoader: '0'
+  perl: '5.008'
 resources:
   bugtracker: https://github.com/Sereal/Sereal/issues
   repository: git://github.com/Sereal/Sereal.git
-version: 3.001_002
+version: 3.001_003
index 53e266a1103f97d3b356e3f663b8edfa8d46ab24..1874463ecc39ca740d7696735aedb695fdced20b 100644 (file)
@@ -5,7 +5,7 @@ use warnings;
 use Carp qw/croak/;
 use XSLoader;
 
-our $VERSION = '3.001_002'; # Don't forget to update the TestCompat set for testing against installed decoders!
+our $VERSION = '3.001_003'; # Don't forget to update the TestCompat set for testing against installed decoders!
 our $XS_VERSION = $VERSION; $VERSION= eval $VERSION;
 
 # not for public consumption, just for testing.
@@ -185,7 +185,7 @@ are documented below under L</"FREEZE/THAW CALLBACK MECHANISM">.
 Beware that using this functionality means a significant slowdown for
 object serialization. Even when serializing objects without a C<FREEZE>
 method, the additional method look up will cost a small amount of runtime.
-Yes, C<Sereal::Encoder> is so fast that is may make a difference.
+Yes, C<Sereal::Encoder> is so fast that this may make a difference.
 
 =head3 no_bless_objects
 
@@ -427,7 +427,7 @@ Here is a contrived example of a class implementing the C<FREEZE> / C<THAW> mech
   # open file handle if necessary and return it
   sub get_fh {
     my $self = shift;
-    # This could also with fancier Moo(se) syntax
+    # This could also be done with fancier Moo(se) syntax
     my $fh = $self->fh;
     if (not $fh) {
       open $fh, "<", $self->path or die $!;
index ee7660ba57ff85589d1da2492ea98c6764c3e832..33eaf3b84a02f3482944c322f29c1fc3b0abcbef 100644 (file)
@@ -34,6 +34,8 @@ Zeev Tarantov <zeev.tarantov@gmail.com>
 
 File modified for Sereal by
 Steffen Mueller <smueller@cpan.org>
+Yves Orton <demerphq@gmail.com>
+
 */
 
 #ifndef CSNAPPY_INTERNAL_USERSPACE_H_
@@ -187,6 +189,12 @@ Albert Lee
 #define int32_t int
 #define int16_t short
 
+#elif defined(__s390x__) || defined(__zarch__) || defined(__SYSC_ZARCH__)
+
+#define __BIG_ENDIAN    87654321
+#define __LITTLE_ENDIAN 12345678
+#define __BYTE_ORDER __BIG_ENDIAN
+
 #endif
 
 #ifndef bswap_16
@@ -261,7 +269,7 @@ static INLINE void UNALIGNED_STORE64(void *p, uint64_t v)
        ptr->x = v;
 }
 
-#elif defined(__hpux) /* strict architectures */
+#elif defined(__hpux) || defined(__sparc) || defined(__sparc__) /* strict architectures */
 
 /* For these platforms, there really are no unaligned loads/stores.
  * Read/write everything as uint8_t. Smart compilers might recognize
index 8ffd40a62f841c4844b49dfd9314c49d151b52e8..6ef6911af686931898a96f07e43520807231072e 100644 (file)
 #define expect_false(expr) expect((expr) != 0, 0)
 #define expect_true(expr)  expect((expr) != 0, 1)
 
+/* these defines are somewhat borrowed from miniz.c */
+
+#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__)
+// SRL_X86_OR_X64_CPU is only used to help set the below macros.
+#define SRL_X86_OR_X64_CPU 1
+#endif
+
+#if SRL_X86_OR_X64_CPU && !defined(SRL_USE_ALIGNED_LOADS_AND_STORES)
+// Set SRL_USE_ALIGNED_LOADS_AND_STORES to 0 on CPU's that permit efficient integer loads and stores from unaligned addresses.
+#define SRL_USE_ALIGNED_LOADS_AND_STORES 0
+#endif
+
+/* HP-UX runs on Itanium but has strict alignment. */
+#ifdef __hpux
+#undef SRL_USE_ALIGNED_LOADS_AND_STORES
+#define SRL_USE_ALIGNED_LOADS_AND_STORES 1
+#endif
+
 #endif
index 2f65aac3a3e05f0723e5186c69bdc5df602f8b54..2608baffbff5528293d29e352a1e44e4ee56eeb1 100644 (file)
@@ -864,6 +864,7 @@ sub _write_file {
 }
 
 # For bootstrapping other language implementations' tests
+our $COMPRESS;
 sub write_test_files {
     my $dir = shift;
     require File::Path;
@@ -880,7 +881,10 @@ sub write_test_files {
         _write_file($make_name_file_name->($testno), $t->[2] . "\n");
     }
 
-    my $encoder = Sereal::Encoder->new({protocol_version => $PROTO_VERSION});
+    my $encoder = Sereal::Encoder->new({
+        protocol_version => $PROTO_VERSION,
+        compress => $COMPRESS || Sereal::Encoder::SRL_UNCOMPRESSED(),
+    });
     foreach my $i (0..$#RoundtripTests) {
         my $testno = @BasicTests + $i + 1;
         my $t = $RoundtripTests[$i];