Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid non-standard statement expressions.
[simgrid.git] / tools / smpi / generate_smpi_defines.pl
index 64d1710..fefb7d0 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 # Copyright 2016 Vincent Danjean <vincent.danjean@inria.fr>
 #                Christian Heinrich <franz-christian.heinrich@inria.fr>
-# 
+#
 # Call this script like this:
 # C/C++  : ./generate_smpi_defines.pl ../../include/smpi/smpi.h
 # FORTRAN: ./generate_smpi_defines.pl -f ../../include/smpi/smpi.h
@@ -12,7 +12,7 @@
 # with MPI+TAU).
 use strict;
 use warnings;
-use Getopt::Std; 
+use Getopt::Std;
 
 my %options=();
 getopts("fc", \%options);
@@ -42,12 +42,7 @@ sub output_macro {
     print "#define ". uc($id) ." smpi_trace_set_call_location(__FILE__,__LINE__); call ". ucfirst $id ."\n";
   }
   else {
-    if ($id eq "MPI_Init") {
-      print "#define MPI_Init(...) ({ smpi_process_init(__VA_ARGS__); smpi_trace_set_call_location(__FILE__,__LINE__); MPI_Init(NULL, NULL); })\n";
-    }
-    else {
-      print "#define $id(...) ({ smpi_trace_set_call_location(__FILE__,__LINE__); $id(__VA_ARGS__); })\n";
-    }
+    print "#define $id(...) (smpi_trace_set_call_location(__FILE__, __LINE__), $id(__VA_ARGS__))\n";
   }
 }
 
@@ -61,7 +56,7 @@ while (defined($line = <>)) {
     }
     $incall=1;
     $wholemacro = $line;
-  } elsif ($incall && $line =~ /^\s+\S/) { 
+  } elsif ($incall && $line =~ /^\s+\S/) {
     # Did we already start parsing an MPI_CALL macro? If so, just concatenate
     $wholemacro .= ' '.$line;
   } elsif ($incall) {