From: Andrew Rodland Date: Tue, 18 Aug 2009 02:53:33 +0000 (-0500) Subject: Fix re-exporting SDL::Constants symbols to caller. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=659a4733e2640c248e268f456021fe834215071a;p=sdlgit%2FSDL_perl.git Fix re-exporting SDL::Constants symbols to caller. This should restore compatibility with <= 2.1.3 without being quite as hackish as that code was. --- diff --git a/lib/SDL.pm b/lib/SDL.pm index b7fb596..0e79ebb 100644 --- a/lib/SDL.pm +++ b/lib/SDL.pm @@ -47,6 +47,13 @@ BEGIN { @EXPORT = qw( in verify &NULL ); }; +# Give our caller SDL::Constant's stuff as well as ours. +sub import { + my $self = shift; + + $self->export_to_level(1, @_); + SDL::Constants->export_to_level(1); +} $VERSION = '2.2.1'; diff --git a/lib/SDL/Constants.pm b/lib/SDL/Constants.pm index fedd9d1..5ed457a 100644 --- a/lib/SDL/Constants.pm +++ b/lib/SDL/Constants.pm @@ -305,10 +305,7 @@ package SDL::Constants; SDL_SAMPLEFLAG_EAGAIN ); -for (@EXPORT) { - *{"SDL::" . $_} = *{$_}; - *{"main::" . $_} = *{$_}; -} +@ISA = qw(Exporter); sub AUDIO_S16 {32784} sub AUDIO_S16MSB {36880}