Alien-Uninum

 view release on metacpan or  search on metacpan

inc/Alien/Uninum/ModuleBuild.pm  view on Meta::CPAN

   
  $self->SUPER::alien_do_commands($phase);
}

package
  main;

use Config;

sub alien_patch {
	my $unicode_h = 'unicode.h';
	my $unicode_h_new = "$unicode_h.tmp";
	open my $in,  '<', $unicode_h;
	open my $out, '>', $unicode_h_new;
	while(<$in>) {
		if(/^typedef.*UTF32;/) {
			# replace the UTF32 tyepdef
			# (it shouldn't be an unsigned long)
			print $out <<END;
/* PATCH: use Perl's U32 for portability */
typedef $Config{u32type}	UTF32;
END
		} else {
			print $out $_;
		}
	}
	close $in;
	close $out;
	unlink $unicode_h;
	rename $unicode_h_new, $unicode_h;
}
 
1;

lib/Alien/Uninum.pm  view on Meta::CPAN


use parent 'Alien::Base';

sub Inline {
	return unless $_[-1] eq 'C'; # Inline's error message is good
	my $self = __PACKAGE__->new;
	+{
		LIBS => $self->libs,
		INC => $self->cflags,
		AUTO_INCLUDE =>
		q/#include <unicode.h>
#include <nsdefs.h>
#include <uninum.h>

/,
	};
}


1;
# ABSTRACT: Alien package for the libuninum library



( run in 1.947 second using v1.01-cache-2.11-cpan-88abd93f124 )