This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
amigaos4: use #ifdef/ifndef __amigaos4__ when feasible
authorAndy Broad <andy@broad.ology.org.uk>
Sun, 13 Sep 2015 18:53:59 +0000 (14:53 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 16 Sep 2015 11:44:31 +0000 (07:44 -0400)
dist/threads/threads.xs
ext/POSIX/POSIX.xs
perl.c
perl.h
pp_sys.c
sv.c
unixish.h
util.c

index 65e63fa..df9950d 100644 (file)
@@ -38,7 +38,7 @@
 
 #ifdef USE_ITHREADS
 
-#if defined(__amigaos4__)
+#ifdef __amigaos4__
 #  undef YIELD
 #  define YIELD sleep(0)
 #endif
index 02c5c47..e31cf04 100644 (file)
@@ -1382,9 +1382,9 @@ char *tzname[] = { "" , "" };
 #  ifdef HAS_UNAME
 #    include <sys/utsname.h>
 #  endif
-#if !defined(__amigaos4__)
-#  include <sys/wait.h>
-#endif
+#  ifndef __amigaos4__
+#    include <sys/wait.h>
+#  endif
 #  ifdef I_UTIME
 #    include <utime.h>
 #  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 (file)
--- 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 (file)
--- 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
index 8ce03bb..f1e2902 100644 (file)
--- 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 (file)
--- 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);
    }
index 69b0eb9..a3985e1 100644 (file)
--- a/unixish.h
+++ b/unixish.h
 
 #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 (file)
--- 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