diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-03-04 15:49:08 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-03-04 15:49:08 -0800 |
| commit | 5a153851c3bc4aa96840438441d5a4c96906b299 (patch) | |
| tree | 51feb5fa5d3dcdb675bfdc70847db99d10976309 /src/error.c | |
| parent | f074951adab882fd128f0a763d9dd9eabd00ea24 (diff) | |
| parent | 0e662e3bcd7d2676eadde28018a8306d66bb9775 (diff) | |
| download | mruby-5a153851c3bc4aa96840438441d5a4c96906b299.tar.gz mruby-5a153851c3bc4aa96840438441d5a4c96906b299.zip | |
Merge pull request #947 from monaka/pr-cleanup-stdio-calls-20130304
Cleanup stdio related.
Diffstat (limited to 'src/error.c')
| -rw-r--r-- | src/error.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/error.c b/src/error.c index 7599bd0a9..ed30173bc 100644 --- a/src/error.c +++ b/src/error.c @@ -6,7 +6,6 @@ #include "mruby.h" #include <stdarg.h> -#include <stdio.h> #include <setjmp.h> #include <string.h> #include "error.h" @@ -209,9 +208,7 @@ mrb_exc_raise(mrb_state *mrb, mrb_value exc) mrb->exc = (struct RObject*)mrb_object(exc); exc_debug_info(mrb, mrb->exc); if (!mrb->jmp) { -#ifdef ENABLE_STDIO mrb_p(mrb, exc); -#endif abort(); } longjmp(*(jmp_buf*)mrb->jmp, 1); @@ -280,23 +277,27 @@ mrb_sprintf(mrb_state *mrb, const char *fmt, ...) void mrb_warn(const char *fmt, ...) { +#ifdef ENABLE_STDIO va_list args; va_start(args, fmt); printf("warning: "); vprintf(fmt, args); va_end(args); +#endif } void mrb_bug(const char *fmt, ...) { +#ifdef ENABLE_STDIO va_list args; va_start(args, fmt); printf("bug: "); vprintf(fmt, args); va_end(args); +#endif exit(EXIT_FAILURE); } |
