Mercurial > repos > blastem
diff gen_arm.c @ 792:724bbec47f86
Use a new fatal_error function instead of calling fprintf and exit for fatal errors. This new function more gracefully handles the case in which BlastEm was not started from a terminal or disconnected from ther terminal (Windows).
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 25 Jul 2015 18:22:07 -0700 |
parents | bff307e03a94 |
children |
line wrap: on
line diff
--- a/gen_arm.c Sat Jul 25 18:19:00 2015 -0700 +++ b/gen_arm.c Sat Jul 25 18:22:07 2015 -0700 @@ -76,8 +76,7 @@ size_t size = CODE_ALLOC_SIZE; uint32_t *next_code = alloc_code(&size); if (!next_code) { - fputs("Failed to allocate memory for generated code\n", stderr); - exit(1); + fatal_error("Failed to allocate memory for generated code\n"); } if (next_code = code->last + RESERVE_WORDS) { //new chunk is contiguous with the current one