Skip to content

Commit

Permalink
style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ghedo committed Dec 18, 2013
1 parent 240b48a commit 36fee36
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
10 changes: 5 additions & 5 deletions Raw.xs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <ffi.h>

#ifdef __MINGW32__
#include <stdint.h>
# include <stdint.h>
#endif

#include "perl_math_int64.h"
Expand Down Expand Up @@ -193,8 +193,8 @@ new(class, library, function, ret_type, ...)
GetLastError();

ffi_raw -> handle = LoadLibrary(library_name);
if(ffi_raw->handle == NULL)

if (ffi_raw->handle == NULL)
Perl_croak(aTHX_ "library not found");

/*if ((error = GetLastError()) != NULL)
Expand All @@ -203,8 +203,8 @@ new(class, library, function, ret_type, ...)
ffi_raw -> fn = GetProcAddress(
ffi_raw -> handle, function_name
);
if(ffi_raw -> fn == NULL)

if (ffi_raw -> fn == NULL)
Perl_croak(aTHX_ "function not found");

/*if ((error = GetLastError()) != NULL)
Expand Down
3 changes: 1 addition & 2 deletions inc/MakeMaker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ override _build_MakeFile_PL_template => sub {

my $template = <<'TEMPLATE';
sub MY::postamble {
if($^O eq 'MSWin32')
{
if ($^O eq 'MSWin32') {
return "\t$^X -MAlien::MSYS=msys_run -e \"chdir 'xs/libffi'; msys_run 'sh configure MAKEILFO=true --disable-builddir --with-pic'; msys_run 'make'\"\n\n";
}
return <<'MAKE_LIBFFI';
Expand Down
12 changes: 8 additions & 4 deletions t/CompileTest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,23 @@ sub compile {
source => $src_file,
extra_compiler_flags => '-std=gnu99'
);
if($^O ne 'MSWin32') {

if ($^O ne 'MSWin32') {
my $lib_file = $b -> link(objects => $obj_file);
return $lib_file;
} else {
require Alien::o2dll;

my $name = $src_file;
$name =~ s/\.c$//;
$name =~ s/^.*(\/|\\)//;
require Alien::o2dll;

Alien::o2dll::o2dll(-o => "$name.dll", $obj_file);

rename "$name.dll", "t/$name.dll";
rename "$name.dll.a", "t/$name.dll.a";
"t/$name.dll";

return "t/$name.dll";
}
}

Expand Down

0 comments on commit 36fee36

Please sign in to comment.