Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] add missing tesh to test user variables tracing
[simgrid.git] / src / gras / DataDesc / ddt_parse.yy.h
index 9ab987b..025bbbb 100644 (file)
@@ -1,8 +1,7 @@
 /* ddt_parse.h -- automatic parsing of data structures                      */
 
-/* Copyright (c) 2003 Arnaud Legrand.                                       */
-/* Copyright (c) 2003, 2004 Martin Quinson.                                 */
-/* All rights reserved.                                                     */
+/* Copyright (c) 2004, 2006, 2007, 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -55,15 +54,11 @@ int gras_ddt_parse_get_debug(void);
 void gras_ddt_parse_set_debug(int bdebug);
 int gras_ddt_parse_lex_destroy(void);
 
-#define PARSE_ERROR_PRE do {
-#define PARSE_ERROR_POST xbt_abort();} while (0)
-
-#define PARSE_ERROR0(fmt)     PARSE_ERROR_PRE \
-                              ERROR3(fmt " at %d:%d of :\n%s", gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,definition);\
-                              PARSE_ERROR_POST
-#define PARSE_ERROR1(fmt,a)   PARSE_ERROR_PRE \
-                              ERROR4(fmt " at %d:%d of :\n%s",a, gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,definition);\
-                              PARSE_ERROR_POST
-#define PARSE_ERROR2(fmt,a,b) PARSE_ERROR_PRE \
-                              ERROR5(fmt " at %d:%d of :\n%s",a,b, gras_ddt_parse_line_pos,gras_ddt_parse_col_pos,definition);\
-                              PARSE_ERROR_POST
+#define PARSE_ERROR(...)                                                \
+  PARSE_ERROR_(__VA_ARGS__,                                             \
+               gras_ddt_parse_line_pos, gras_ddt_parse_col_pos, definition)
+#define PARSE_ERROR_(fmt, ...)                           \
+  do {                                                   \
+    XBT_ERROR(fmt " at %d:%d of :\n%s", __VA_ARGS__);   \
+    xbt_abort();                                         \
+  } while (0)