--- a/MPI/Unsafe.pl 2008-10-06 15:52:17.000000000 +0200 +++ b/MPI/Unsafe.pl 2010-02-25 21:25:07.000000000 +0100 @@ -96,7 +96,7 @@ } # Grab the command-line arguments -$mpi_header=shift @ARGV; +$mpi_header = (@ARGV > 3) ? shift @ARGV : "/usr/include/mpi.h"; $unsafe_input = shift @ARGV; $unsafe_output = shift @ARGV; $cbridge_output = shift @ARGV; @@ -130,7 +130,7 @@ } push(@mpi_status_fields, " $access $type $name;\n"); } - } elsif ($line =~ /\s*#\s*define\s*(MPI_[A-Za-z0-9_]*)\s*(.*)/) { + } elsif ($line =~ /\s*#define\s+(MPI_[A-Za-z0-9_]*)\s*(.*)/) { # Found an MPI_* constant defined by the preprocessor my $name = $1; my $value = $2; @@ -145,7 +145,7 @@ } elsif ($in_enum) { parse_enum($line); } elsif ($line =~ /typedef\s+struct\s+([A-Za-z_][A-Za-z0-9_]*)\s+MPI_Status/) { - $mpi_status_name = $2; + $mpi_status_name = $1; } elsif ($line =~ /struct $mpi_status_name[^;]*$/) { $in_mpi_status=1; } @@ -183,7 +183,11 @@ # This is a constant we need to replace. my $value = $constants{$constant}; - if ($value =~ /&/ or $constant =~ /_FN$/) { + if ($value =~ /LAM_MPI_C_.+\(FN|NULL|IGNORE\)/) { + # this is for you LAM :-) + print UNSAFE_OUTPUT ("$whitespace","public static readonly $type $constant = mpinet_$constant();\n"); + push (@cbridge_constants, "$type:$constant"); + } elsif ($value =~ /&/ or $constant =~ /_FN$/) { # If we're taking the address of something, or if this # is a _FN constant, it needs to be done in the C # bridge *unless* this is just a fancy name for the