Skip to content

Commit

Permalink
XXX craig Unixish.h, doshish.h: Reorder terminations; simplify
Browse files Browse the repository at this point in the history
The IO and memory terminations need to be after other things.  Add a
comment so that future maintainers won't make the mistakes I did.

Also refactor to that amiga os doesn't have a separate list to get out
of sync

I suspect that the amiga termination should be moved to earlier in
the sequence, but absent any evidence; I'm leaving it unchanged.
  • Loading branch information
khwilliamson committed May 9, 2021
1 parent 62eab4f commit dcb84cb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
8 changes: 5 additions & 3 deletions dosish.h
Expand Up @@ -47,12 +47,14 @@
# define BIT_BUCKET "\\dev\\nul" /* "wanna be like, umm, Newlined, or somethin?" */
#endif

/* Generally add things last-in first-terminated. IO and memory terminations
* need to be generally last */
#ifndef PERL_SYS_TERM_BODY
# define PERL_SYS_TERM_BODY() \
ENV_TERM; USER_PROP_MUTEX_TERM; LOCALE_TERM; \
HINTS_REFCNT_TERM; KEYWORD_PLUGIN_MUTEX_TERM; \
OP_CHECK_MUTEX_TERM; OP_REFCNT_TERM; PERLIO_TERM; \
MALLOC_TERM; LOCALE_TERM; USER_PROP_MUTEX_TERM; \
ENV_TERM;
OP_CHECK_MUTEX_TERM; OP_REFCNT_TERM; \
PERLIO_TERM; MALLOC_TERM;
#endif
#define dXSUB_SYS dNOOP

Expand Down
37 changes: 18 additions & 19 deletions unixish.h
Expand Up @@ -136,29 +136,28 @@ int afstat(int fd, struct stat *statb);
#define Mkdir(path,mode) mkdir((path),(mode))

#if defined(__amigaos4__)
# define PERL_SYS_INIT_BODY(c,v) \
MALLOC_CHECK_TAINT2(*c,*v) PERL_FPU_INIT; PERLIO_INIT; MALLOC_INIT; amigaos4_init_fork_array(); amigaos4_init_environ_sema();
# define PERL_SYS_TERM_BODY() \
HINTS_REFCNT_TERM; KEYWORD_PLUGIN_MUTEX_TERM; \
OP_CHECK_MUTEX_TERM; OP_REFCNT_TERM; PERLIO_TERM; \
MALLOC_TERM; LOCALE_TERM; USER_PROP_MUTEX_TERM; \
ENV_TERM; \
amigaos4_dispose_fork_array();
# define AMIGAOS_SYS_TERM_ amigaos4_dispose_fork_array()
# define AMIGAOS_SYS_INIT_ STMT_START { \
amigaos4_init_fork_array(); \
amigaos4_init_environ_sema(); \
} STMT_END
#else
# define AMIGAOS_SYS_TERM_ NOOP
# define AMIGAOS_SYS_INIT_ NOOP
#endif

#ifndef PERL_SYS_INIT_BODY
# define PERL_SYS_INIT_BODY(c,v) \
MALLOC_CHECK_TAINT2(*c,*v) PERL_FPU_INIT; PERLIO_INIT; MALLOC_INIT
#endif
#define PERL_SYS_INIT_BODY(c,v) \
MALLOC_CHECK_TAINT2(*c,*v) PERL_FPU_INIT; PERLIO_INIT; \
MALLOC_INIT; AMIGAOS_SYS_INIT_;

#ifndef PERL_SYS_TERM_BODY
# define PERL_SYS_TERM_BODY() \
/* Generally add things last-in first-terminated. IO and memory terminations
* need to be generally last */
#define PERL_SYS_TERM_BODY() \
ENV_TERM; USER_PROP_MUTEX_TERM; LOCALE_TERM; \
HINTS_REFCNT_TERM; KEYWORD_PLUGIN_MUTEX_TERM; \
OP_CHECK_MUTEX_TERM; OP_REFCNT_TERM; PERLIO_TERM; \
MALLOC_TERM; LOCALE_TERM; USER_PROP_MUTEX_TERM; \
ENV_TERM;

#endif
OP_CHECK_MUTEX_TERM; OP_REFCNT_TERM; \
PERLIO_TERM; MALLOC_TERM; \
AMIGAOS_SYS_TERM_;

#define BIT_BUCKET "/dev/null"

Expand Down

0 comments on commit dcb84cb

Please sign in to comment.