From: Nicholas Clark <nick@ccl4.org>
Date: Mon, 1 May 2006 17:28:43 +0000 (+0000)
Subject: Allow a macro of "0" to mean "#if 0" for convenient elimination of
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=71adef125534c48a9b41d31beff5cf0c57c9c240;p=p5sagit%2Fp5-mst-13.2.git

Allow a macro of "0" to mean "#if 0" for convenient elimination of
constants.

p4raw-id: //depot/perl@28038
---

diff --git a/lib/ExtUtils/Constant/Base.pm b/lib/ExtUtils/Constant/Base.pm
index 8dab240..48e0c37 100644
--- a/lib/ExtUtils/Constant/Base.pm
+++ b/lib/ExtUtils/Constant/Base.pm
@@ -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 "";
 }