From: gregor herrmann Date: Tue, 15 Jul 2014 14:21:23 +0000 (+0200) Subject: Imported Upstream version 3.001.003 X-Git-Tag: archive/raspbian/4.017+ds-1+rpi1~1^2~3^2~24 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3f62750b754c438a619c16a8b78a12bae7651c59;p=libsereal-encoder-perl.git Imported Upstream version 3.001.003 --- diff --git a/META.json b/META.json index 6f4afa3..c40b123 100644 --- a/META.json +++ b/META.json @@ -4,7 +4,7 @@ "Steffen Mueller , Yves Orton " ], "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" } diff --git a/META.yml b/META.yml index 5328878..7923d7e 100644 --- a/META.yml +++ b/META.yml @@ -3,33 +3,33 @@ abstract: 'Fast, compact, powerful binary serialization' author: - 'Steffen Mueller , Yves Orton ' 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 diff --git a/lib/Sereal/Encoder.pm b/lib/Sereal/Encoder.pm index 53e266a..1874463 100644 --- a/lib/Sereal/Encoder.pm +++ b/lib/Sereal/Encoder.pm @@ -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. Beware that using this functionality means a significant slowdown for object serialization. Even when serializing objects without a C method, the additional method look up will cost a small amount of runtime. -Yes, C is so fast that is may make a difference. +Yes, C 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 / C 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 $!; diff --git a/snappy/csnappy_internal_userspace.h b/snappy/csnappy_internal_userspace.h index ee7660b..33eaf3b 100644 --- a/snappy/csnappy_internal_userspace.h +++ b/snappy/csnappy_internal_userspace.h @@ -34,6 +34,8 @@ Zeev Tarantov File modified for Sereal by Steffen Mueller +Yves Orton + */ #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 diff --git a/srl_common.h b/srl_common.h index 8ffd40a..6ef6911 100644 --- a/srl_common.h +++ b/srl_common.h @@ -13,4 +13,22 @@ #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 diff --git a/t/lib/Sereal/TestSet.pm b/t/lib/Sereal/TestSet.pm index 2f65aac..2608baf 100644 --- a/t/lib/Sereal/TestSet.pm +++ b/t/lib/Sereal/TestSet.pm @@ -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];