From ea34f6bdec386db6b5e951fae85f430965078a86 Mon Sep 17 00:00:00 2001 From: Andy Broad Date: Sun, 13 Sep 2015 14:53:59 -0400 Subject: [PATCH] amigaos4: use #ifdef/ifndef __amigaos4__ when feasible --- dist/threads/threads.xs | 2 +- ext/POSIX/POSIX.xs | 8 ++++---- perl.c | 2 +- perl.h | 2 +- pp_sys.c | 6 +++--- sv.c | 2 +- unixish.h | 2 +- util.c | 6 +++--- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/dist/threads/threads.xs b/dist/threads/threads.xs index 65e63fa..df9950d 100644 --- a/dist/threads/threads.xs +++ b/dist/threads/threads.xs @@ -38,7 +38,7 @@ #ifdef USE_ITHREADS -#if defined(__amigaos4__) +#ifdef __amigaos4__ # undef YIELD # define YIELD sleep(0) #endif diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 02c5c47..e31cf04 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -1382,9 +1382,9 @@ char *tzname[] = { "" , "" }; # ifdef HAS_UNAME # include # endif -#if !defined(__amigaos4__) -# include -#endif +# ifndef __amigaos4__ +# include +# endif # ifdef I_UTIME # include # endif @@ -3187,7 +3187,7 @@ sigpending(sigset) ALIAS: sigsuspend = 1 CODE: -#if defined(__amigaos4__) +#ifdef __amigaos4__ RETVAL = not_here("sigpending"); #else RETVAL = ix ? sigsuspend(sigset) : sigpending(sigset); diff --git a/perl.c b/perl.c index d1018f3..1bd2cbb 100644 --- a/perl.c +++ b/perl.c @@ -1501,7 +1501,7 @@ perl_parse(pTHXx_ XSINIT_t xsinit, int argc, char **argv, char **env) } #endif /* #if defined(USE_HASH_SEED) || defined(USE_HASH_SEED_EXPLICIT) */ -#if defined(__amigaos4__) +#ifdef __amigaos4__ { struct NameTranslationInfo nti; __translate_amiga_to_unix_path_name(&argv[0],&nti); diff --git a/perl.h b/perl.h index 1e8ca3c..a1a50b3 100644 --- a/perl.h +++ b/perl.h @@ -2803,7 +2803,7 @@ typedef struct padname PADNAME; # include "unixish.h" #endif -#if defined(__amigaos4__) +#ifdef __amigaos4__ # include "amigaos.h" # undef FD_CLOEXEC /* a lie in AmigaOS */ #endif diff --git a/pp_sys.c b/pp_sys.c index 8ce03bb..f1e2902 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -4321,7 +4321,7 @@ PP(pp_system) PERL_FLUSHALL_FOR_CHILD; #if (defined(HAS_FORK) || defined(__amigaos4__)) && !defined(VMS) && !defined(OS2) || defined(PERL_MICRO) { -#if defined(__amigaos4__) +#ifdef __amigaos4__ struct UserData userdata; pthread_t proc; #else @@ -4336,7 +4336,7 @@ PP(pp_system) if (PerlProc_pipe(pp) >= 0) did_pipes = 1; -#if defined(__amigaos4__) +#ifdef __amigaos4__ amigaos_fork_set_userdata(aTHX_ &userdata, did_pipes, @@ -4416,7 +4416,7 @@ PP(pp_system) if (n != sizeof(int)) DIE(aTHX_ "panic: kid popen errno read, n=%u", n); errno = errkid; /* Propagate errno from kid */ -#if defined(__amigaos4__) +#ifdef __amigaos4__ /* The pipe always has something in it * so n alone is not enough. */ if (errno > 0) diff --git a/sv.c b/sv.c index aec1568..dc2ba8b 100644 --- a/sv.c +++ b/sv.c @@ -14408,7 +14408,7 @@ perl_clone(PerlInterpreter *proto_perl, UV flags) /* perlhost.h so we need to call into it to clone the host, CPerlHost should have a c interface, sky */ -#if !defined(__amigaos4__) +#ifndef __amigaos4__ if (flags & CLONEf_CLONE_HOST) { return perl_clone_host(proto_perl,flags); } diff --git a/unixish.h b/unixish.h index 69b0eb9..a3985e1 100644 --- a/unixish.h +++ b/unixish.h @@ -123,7 +123,7 @@ #define Stat(fname,bufptr) stat((fname),(bufptr)) -#if defined(__amigaos4__) +#ifdef __amigaos4__ int afstat(int fd, struct stat *statb); # define Fstat(fd,bufptr) afstat((fd),(bufptr)) #endif diff --git a/util.c b/util.c index b5f04a5..4cae40c 100644 --- a/util.c +++ b/util.c @@ -2055,7 +2055,7 @@ void Perl_my_setenv(pTHX_ const char *nam, const char *val) { dVAR; -#if defined(__amigaos4__) +#ifdef __amigaos4__ amigaos4_obtain_environ(__FUNCTION__); #endif #ifdef USE_ITHREADS @@ -2099,7 +2099,7 @@ Perl_my_setenv(pTHX_ const char *nam, const char *val) environ[i] = environ[i+1]; i++; } -#if defined(__amigaos4__) +#ifdef __amigaos4__ goto my_setenv_out; #else return; @@ -2164,7 +2164,7 @@ Perl_my_setenv(pTHX_ const char *nam, const char *val) } #endif } -#if defined(__amigaos4__) +#ifdef __amigaos4__ my_setenv_out: amigaos4_release_environ(__FUNCTION__); #endif -- 1.8.3.1