Update of /cvsroot/perl-win32-gui/Win32-GUI
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23518

Modified Files:
        GUI.pm 
Log Message:
Fix Win32::GUI::constant() to support old calling method for WIN32__GUI__ 
constants

Index: GUI.pm
===================================================================
RCS file: /cvsroot/perl-win32-gui/Win32-GUI/GUI.pm,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** GUI.pm      17 May 2006 21:13:27 -0000      1.43
--- GUI.pm      18 May 2006 19:40:36 -0000      1.44
***************
*** 43,48 ****
  # The default exports are deprecated, and will be removed in the future
  sub import {
-     my ($callpkg, $file, $line) = caller;
      my $pkg = shift;
      my @imports = @_;
  
--- 43,48 ----
  # The default exports are deprecated, and will be removed in the future
  sub import {
      my $pkg = shift;
+     my $callpkg = caller;
      my @imports = @_;
  
***************
*** 55,62 ****
          use warnings;
        warnings::warnif 'deprecated',
!                   "use Win32::GUI; is currently exporting constants into ".
            "the callers scope. This functionality is deprecated. ".
!           "Use 'use Win32::GUI();' or list your required exports explicitly 
instead. ".
!                   "Used at $file line $line.\n";
        @imports = qw(:compatibility_win32_gui);
      }
--- 55,62 ----
          use warnings;
        warnings::warnif 'deprecated',
!                   "'use Win32::GUI;' is currently exporting constants into ".
            "the callers scope. This functionality is deprecated. ".
!           "Use 'use Win32::GUI();' or list your required exports ".
!             "explicitly instead.";
        @imports = qw(:compatibility_win32_gui);
      }
***************
*** 88,96 ****
  sub constant {
      my $constant = shift;
-     my ($callpkg, $file, $line) = caller;
      use warnings;
      warnings::warnif 'deprecated', "Use of Win32::GUI::constant() is 
deprecated. ".
!         "Use Win32::GUI::Constants::constant() instead. ".
!         "Used at $file line $line.\n";
      require Win32::GUI::Constants;
      return Win32::GUI::Constants::constant($constant);
--- 88,100 ----
  sub constant {
      my $constant = shift;
      use warnings;
+     if($constant =~ /^WIN32__GUI__/) {
+         warnings::warnif 'deprecated', "Use of Win32::GUI::constant() is 
deprecated. ".
+             "Use Win32::GUI::_constant() instead for WIN32__GUI__* 
constants.";
+         return Win32::GUI::_constant($constant);
+     }
+ 
      warnings::warnif 'deprecated', "Use of Win32::GUI::constant() is 
deprecated. ".
!         "Use Win32::GUI::Constants::constant() instead.";
      require Win32::GUI::Constants;
      return Win32::GUI::Constants::constant($constant);
***************
*** 114,119 ****
          use warnings;
          warnings::warnif 'deprecated',
!             "Use of '$AUTOLOAD' is deprecated. Use 
'Win32::GUI::Constants::$constant' instead. ".
!             "Used at $file line $line.\n";
          goto &$AUTOLOAD;
      }
--- 118,122 ----
          use warnings;
          warnings::warnif 'deprecated',
!             "Use of '$AUTOLOAD' is deprecated. Use 
'Win32::GUI::Constants::$constant' instead.";
          goto &$AUTOLOAD;
      }


Reply via email to