controlled_exit only for WinGUI and shared ngspice

This commit is contained in:
Holger Vogt 2020-04-25 20:22:40 +02:00
parent 0a8f700311
commit e1a69e3fc5
1 changed files with 4 additions and 0 deletions

View File

@ -185,7 +185,11 @@ static void overflow_error(size_t num, size_t size)
(void) fprintf(stderr, "Cannot allocate %zu X %zu bytes: "
"Product exceeds largest size_t = %zu.\n",
num, size, SIZE_MAX);
#if defined HAS_WINGUI || defined SHARED_MODULE
controlled_exit(EXIT_FAILURE);
#else
exit(EXIT_FAILURE);
#endif
} /* end of function overflow_error */
#endif /* #ifndef HAVE_LIBGC */