This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow a macro of "0" to mean "#if 0" for convenient elimination of
authorNicholas Clark <nick@ccl4.org>
Mon, 1 May 2006 17:28:43 +0000 (17:28 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 1 May 2006 17:28:43 +0000 (17:28 +0000)
constants.

p4raw-id: //depot/perl@28038

lib/ExtUtils/Constant/Base.pm

index 8dab240..48e0c37 100644 (file)
@@ -5,7 +5,7 @@ use vars qw($VERSION $is_perl56);
 use Carp;
 use Text::Wrap;
 use ExtUtils::Constant::Utils qw(C_stringify perl_stringify);
-$VERSION = '0.02';
+$VERSION = '0.03';
 
 $is_perl56 = ($] < 5.007 && $] > 5.005_50);
 
@@ -78,7 +78,7 @@ sub macro_to_ifdef {
        return $macro->[0];
     }
     if (defined $macro && $macro ne "" && $macro ne "1") {
-       return "#ifdef $macro\n";
+       return $macro ? "#ifdef $macro\n" : "#if 0\n";
     }
     return "";
 }