Skip to content

Commit

Permalink
Added Inline with SDL support
Browse files Browse the repository at this point in the history
  • Loading branch information
kthakore committed Dec 27, 2010
1 parent 668feb2 commit 5e45d5f
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lib/SDL.pm
Expand Up @@ -90,4 +90,32 @@ sub set_error {
SDL::set_error_real( sprintf( $format, @arguments ) );
}


# Hints for Inline.pm
sub Inline
{
my $language = shift;
if ($language ne 'C') {
warn "Warning: SDL.pm does not provide Inline hints for the $language language\n";
return
}

require Alien::SDL;
require File::Spec;
my $libs = Alien::SDL->config('libs');
my $cflags = Alien::SDL->config('cflags');
my $path;
my $sdl_typemap = File::Spec->catfile( 'SDL', 'typemap' );
grep { my $find = File::Spec->catfile( $_, $sdl_typemap );
$path = $find if -e $find } @INC;
return {
LIBS => $libs,
CCFLAGS => $cflags,
TYPEMAPS => $path,
};



}

1;

0 comments on commit 5e45d5f

Please sign in to comment.