From: Augustin DEGOMME AD254919 Date: Mon, 18 Jun 2018 12:42:01 +0000 (+0200) Subject: add support fort getopt_long_only, as mpimemu uses it X-Git-Tag: v3.20~87 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a69f8338676e77525c4353c1099137857ca02c33 add support fort getopt_long_only, as mpimemu uses it --- diff --git a/include/smpi/smpi_helpers.h b/include/smpi/smpi_helpers.h index c7107059ec..092d64d089 100644 --- a/include/smpi/smpi_helpers.h +++ b/include/smpi/smpi_helpers.h @@ -33,5 +33,6 @@ int smpi_getopt (int argc, char *const *argv, const char *options); #define getopt(x,y,z) smpi_getopt(x,y,z) #define getopt_long(x,y,z,a,b) smpi_getopt_long(x,y,z,a,b) +#define getopt_long_only(x,y,z,a,b) smpi_getopt_long_only(x,y,z,a,b) #endif diff --git a/src/smpi/internals/smpi_bench.cpp b/src/smpi/internals/smpi_bench.cpp index 281d79f41d..56b211e352 100644 --- a/src/smpi/internals/smpi_bench.cpp +++ b/src/smpi/internals/smpi_bench.cpp @@ -443,6 +443,17 @@ void smpi_bench_destroy() samples.clear(); } +int smpi_getopt_long_only (int argc, char *const *argv, const char *options, + const struct option * long_options, int *opt_index) +{ + if (smpi_process()) + optind = smpi_process()->get_optind(); + int ret = getopt_long_only (argc, argv, options, long_options, opt_index); + if (smpi_process()) + smpi_process()->set_optind(optind); + return ret; +} + int smpi_getopt_long (int argc, char *const *argv, const char *options, const struct option * long_options, int *opt_index) {