diff options
author | 2013-03-25 20:06:16 +0000 | |
---|---|---|
committer | 2013-03-25 20:06:16 +0000 | |
commit | 898184e3e61f9129feb5978fad5a8c6865f00b92 (patch) | |
tree | 56f32aefc1eed60b534611007c7856f82697a205 /gnu/usr.bin/perl/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/Base.pm | |
parent | PGSHIFT -> PAGE_SHIFT (diff) | |
download | wireguard-openbsd-898184e3e61f9129feb5978fad5a8c6865f00b92.tar.xz wireguard-openbsd-898184e3e61f9129feb5978fad5a8c6865f00b92.zip |
import perl 5.16.3 from CPAN - worked on by Andrew Fresh and myself
Diffstat (limited to 'gnu/usr.bin/perl/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/Base.pm')
-rw-r--r-- | gnu/usr.bin/perl/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/Base.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/Base.pm b/gnu/usr.bin/perl/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/Base.pm index b5b79af1ea7..b6abe1c201a 100644 --- a/gnu/usr.bin/perl/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/Base.pm +++ b/gnu/usr.bin/perl/cpan/ExtUtils-Constant/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) = @_; |