From fdbf720097c9e51eef43f0c9811ab5899789349a Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 24 Mar 2011 16:04:25 +0100 Subject: [PATCH 1/1] Preparation for the removal of THROW1 in SG/svn. --- TODO | 2 ++ main.cpp | 12 +++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/TODO b/TODO index d59eb3c..bee25a1 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,5 @@ +* When ready, remove hack for THROWF in main.cpp. + * Support heterogeneous platforms? Not sure yet. Should be doable if each process also sends its speed to its neighbors. diff --git a/main.cpp b/main.cpp index 76125e9..c2b1d18 100644 --- a/main.cpp +++ b/main.cpp @@ -6,6 +6,12 @@ #include #include +// Don't look at this dirty hack... +// Delete it when THROWF comes in SG/svn. +#ifndef THROWF +#define THROWF(...) THROW1(__VA_ARGS__) +#endif + // Creates log categories XBT_LOG_NEW_CATEGORY(simu, "Root of simulation messages"); XBT_LOG_NEW_SUBCATEGORY(main, simu, "Messages from global infrastructure"); @@ -98,10 +104,10 @@ static int simulation_main(int argc, char* argv[]) delete proc; } catch (const std::invalid_argument& e) { - THROW1(arg_error, 0, "%s", e.what()); + THROWF(arg_error, 0, "%s", e.what()); } catch (const std::exception& e) { - THROW1(0, 0, "%s", e.what()); + THROWF(0, 0, "%s", e.what()); } return result; } @@ -255,7 +261,7 @@ int main(int argc, char* argv[]) delete proc_mutex; if (res != MSG_OK) - THROW1(0, 0, "MSG_main() failed with status %#x", res); + THROWF(0, 0, "MSG_main() failed with status %#x", res); exit_status = EXIT_NO_FAILURE; // ===== } -- 2.39.5