diff options
author | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-09-02 14:51:51 +0000 |
---|---|---|
committer | Mikael Djurfeldt <djurfeldt@nada.kth.se> | 1999-09-02 14:51:51 +0000 |
commit | e52ceaacf03e0ce8ee40b99a914c039d26addec1 (patch) | |
tree | 0c73962eb177307aa30162b1191db1879fdceb72 /libguile/gc.c | |
parent | 6babbc74d72eafeb925c59acb4f2ef90b512782c (diff) | |
download | guile-e52ceaacf03e0ce8ee40b99a914c039d26addec1.tar.gz |
* gc.c (cleanup, scm_init_storage): Use on_exit if present and
atexit not available. (sunos4.1.4 needs it.)
Diffstat (limited to 'libguile/gc.c')
-rw-r--r-- | libguile/gc.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libguile/gc.c b/libguile/gc.c index ea28c92d1..89c03a297 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -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); |