From: Arthur Axel "fREW" Schmidt Date: Wed, 1 Sep 2010 21:03:42 +0000 (+0000) Subject: I was wrong, we still need this check X-Git-Tag: v0.09006~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f5624560f5f6293db016e6d4e385faa5bdf54ad;p=p5sagit%2FClass-Accessor-Grouped.git I was wrong, we still need this check --- diff --git a/Changes b/Changes index 3e076c2..a4ae4e4 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Class::Accessor::Grouped. +0.09005 Wed Sep 1 04:00:00 2010 + - Again, remove Class::XSAccessor for Win32 sine it still breaks + 0.09004 Wed Aug 11 04:23:15 2010 - Changed the way Class::XSAccessor is invoked if available (recommended by C::XSA author) @@ -40,7 +43,7 @@ Revision history for Class::Accessor::Grouped. - Tweak code for pure speed while fixing performance issue when assigning @_ under Perl 5.10.0 -0.07000 +0.07000 - Altered get_inherited to return undef rather than () when no value set for Class::Data::(Inheritable|Accessor) compatiblity - Fixed spelling test error diff --git a/lib/Class/Accessor/Grouped.pm b/lib/Class/Accessor/Grouped.pm index 638b0b9..5cd7e95 100644 --- a/lib/Class/Accessor/Grouped.pm +++ b/lib/Class/Accessor/Grouped.pm @@ -7,19 +7,24 @@ use Scalar::Util (); use MRO::Compat; use Sub::Name (); -our $VERSION = '0.09004'; +our $VERSION = '0.09005'; $VERSION = eval $VERSION; +# Class::XSAccessor is segfaulting on win32, so be careful +# Win32 users can set $hasXS to try to use it anyway + our $hasXS; sub _hasXS { if (not defined $hasXS) { $hasXS = 0; - eval { - require Class::XSAccessor; - $hasXS = 1; - }; + if ($^O ne 'MSWin32') { + eval { + require Class::XSAccessor; + $hasXS = 1; + }; + } } return $hasXS; @@ -81,7 +86,7 @@ sub mk_group_accessors { # So we don't have to do lots of lookups inside the loop. $maker = $self->can($maker) unless ref $maker; - + my $hasXS = _hasXS(); foreach my $field (@fields) { @@ -93,7 +98,7 @@ sub mk_group_accessors { my $name = $field; ($name, $field) = @$field if ref $field; - + my $alias = "_${name}_accessor"; my $full_name = join('::', $class, $name); my $full_alias = join('::', $class, $alias); @@ -111,10 +116,10 @@ sub mk_group_accessors { else { my $accessor = $self->$maker($group, $field); my $alias_accessor = $self->$maker($group, $field); - + *$full_name = Sub::Name::subname($full_name, $accessor); #unless defined &{$class."\:\:$field"} - + *$full_alias = Sub::Name::subname($full_alias, $alias_accessor); #unless defined &{$class."\:\:$alias"} }