mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 04:40:29 +02:00
* gc.c (cleanup, scm_init_storage): Use on_exit if present and
atexit not available. (sunos4.1.4 needs it.)
This commit is contained in:
parent
6babbc74d7
commit
e52ceaacf0
1 changed files with 15 additions and 1 deletions
|
@ -1858,7 +1858,17 @@ scm_unprotect_object (obj)
|
|||
int terminating;
|
||||
|
||||
/* called on process termination. */
|
||||
static void cleanup (void)
|
||||
#ifdef HAVE_ATEXIT
|
||||
static void
|
||||
cleanup (void)
|
||||
#else
|
||||
#ifdef HAVE_ON_EXIT
|
||||
static void
|
||||
cleanup (int status, void *arg)
|
||||
#else
|
||||
#error Dont know how to setup a cleanup handler on your system.
|
||||
#endif
|
||||
#endif
|
||||
{
|
||||
terminating = 1;
|
||||
scm_flush_all_ports ();
|
||||
|
@ -1905,6 +1915,10 @@ scm_init_storage (scm_sizet init_heap_size)
|
|||
|
||||
#ifdef HAVE_ATEXIT
|
||||
atexit (cleanup);
|
||||
#else
|
||||
#ifdef HAVE_ON_EXIT
|
||||
on_exit (cleanup, 0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
scm_undefineds = scm_cons (SCM_UNDEFINED, SCM_EOL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue