diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/ExtUtils/Constant/Base.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/ExtUtils/Constant/Base.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Master/tlpkg/tlperl/lib/ExtUtils/Constant/Base.pm b/Master/tlpkg/tlperl/lib/ExtUtils/Constant/Base.pm index b5b79af1ea7..b6abe1c201a 100644 --- a/Master/tlpkg/tlperl/lib/ExtUtils/Constant/Base.pm +++ b/Master/tlpkg/tlperl/lib/ExtUtils/Constant/Base.pm @@ -5,7 +5,7 @@ use vars qw($VERSION); use Carp; use Text::Wrap; use ExtUtils::Constant::Utils qw(C_stringify perl_stringify); -$VERSION = '0.04'; +$VERSION = '0.05'; use constant is_perl56 => ($] < 5.007 && $] > 5.005_50); @@ -83,6 +83,18 @@ sub macro_to_ifdef { return ""; } +sub macro_to_ifndef { + my ($self, $macro) = @_; + if (ref $macro) { + # Can't invert these stylishly, so "bodge it" + return "$macro->[0]#else\n"; + } + if (defined $macro && $macro ne "" && $macro ne "1") { + return $macro ? "#ifndef $macro\n" : "#if 1\n"; + } + croak "Can't generate an ifndef for unconditional code"; +} + sub macro_to_endif { my ($self, $macro) = @_; |