pike.git/
src/
error.c
Branch:
Tag:
Non-build tags
All tags
No tags
2016-01-11
2016-01-11 19:49:51 by Martin Nilsson <nilsson@fastmail.com>
a91d9ab768215cd0c1d6d16ef49aa72c6885d825 (
13
lines) (+
7
/-
6
)
[
Show
|
Annotate
]
Branch:
8.1
Use variadic macros.
860:
*/ #ifdef ERROR_DEBUG
-
#define DWERROR(
X
)
fprintf
X
+
#define DWERROR(
...
) fprintf
(stderr,
__VA_ARGS__)
#else /* !ERROR_DEBUG */
-
#define DWERROR(
X
)
+
#define DWERROR(
...
)
#endif /* ERROR_DEBUG */ #define INIT_ERROR(FEL)\
870:
struct object *o; \ va_start(foo,desc); \ ASSERT_THREAD_SWAPPED_IN(); \
-
DWERROR(
(stderr,
"%s(): Throwing a " #FEL " error\n", func)
)
; \
+
DWERROR("%s(): Throwing a " #FEL " error\n", func); \
o=fast_clone_object(PIKE_CONCAT(FEL,_error_program)) #define ERROR_DONE(FOO) \
994:
va_list foo; va_start(foo,desc); ASSERT_THREAD_SWAPPED_IN();
-
DWERROR(
(stderr,
"%s(): Throwing an error object\n", func)
)
;
+
DWERROR("%s(): Throwing an error object\n", func);
ERROR_DONE(generic); }
1039:
else ERROR_STRUCT(bad_argument,o)->expected_type = NULL; ERROR_COPY_SVALUE(bad_argument, got_value);
-
DWERROR(
(stderr,
"%s():Bad arg %d (expected %s)\n",
-
func, which_argument, expected_type)
)
;
+
DWERROR("%s():Bad arg %d (expected %s)\n",
+
func, which_argument, expected_type);
ERROR_DONE(generic); }