Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill old $Id$ command dating from CVS
[simgrid.git] / src / xbt / asserts.c
1 /*  xbt/asserts.h -- assertion mechanism                                     */
2
3 /* Copyright (c) 2004,2005 Martin Quinson. All rights reserved.             */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #include <stdlib.h>             /* abort */
9 #include "xbt/log.h"
10 #include "xbt/asserts.h"
11
12 XBT_LOG_EXTERNAL_CATEGORY(xbt);
13 XBT_LOG_DEFAULT_CATEGORY(xbt);
14
15 /**
16  * @brief Kill the program with an error message
17  * \param msg
18  *
19  * Things are so messed up that the only thing to do now, is to stop the program.
20  *
21  * The message is handled by a CRITICAL logging request
22  *
23  * If you want to pass arguments to the format, you can always write xbt_assert1(0,"fmt",args) or
24  * xbt_die(bprintf("fmt", arg))
25  */
26 void xbt_die(const char *msg)
27 {
28   CRITICAL1("%s", msg);
29   xbt_abort();
30 }
31
32 /** @brief Kill the program in silence */
33 void xbt_abort(void)
34 {
35   abort();
36 }