regen/reentr.pl: simplify cpp conditionals
authorAaron Crane <arc@cpan.org>
Sat, 14 Oct 2017 08:48:10 +0000 (10:48 +0200)
committerAaron Crane <arc@cpan.org>
Sat, 21 Oct 2017 15:53:08 +0000 (16:53 +0100)
reentr.c
regen/reentr.pl

index 70b971b..166777e 100644 (file)
--- a/reentr.c
+++ b/reentr.c
@@ -59,16 +59,12 @@ Perl_reentrant_size(pTHX) {
        PL_reentrant_buffer->_grent_size = sysconf(_SC_GETGR_R_SIZE_MAX);
        if (PL_reentrant_buffer->_grent_size == (size_t) -1)
                PL_reentrant_buffer->_grent_size = REENTRANTUSUALSIZE;
-#   else
-#       if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
+#   elif defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
        PL_reentrant_buffer->_grent_size = SIABUFSIZ;
-#       else
-#           ifdef __sgi
+#   elif defined(__sgi)
        PL_reentrant_buffer->_grent_size = BUFSIZ;
-#           else
+#   else
        PL_reentrant_buffer->_grent_size = REENTRANTUSUALSIZE;
-#           endif
-#       endif
 #   endif 
 #endif /* HAS_GETGRNAM_R */
 #ifdef HAS_GETHOSTBYNAME_R
@@ -94,16 +90,12 @@ Perl_reentrant_size(pTHX) {
        PL_reentrant_buffer->_pwent_size = sysconf(_SC_GETPW_R_SIZE_MAX);
        if (PL_reentrant_buffer->_pwent_size == (size_t) -1)
                PL_reentrant_buffer->_pwent_size = REENTRANTUSUALSIZE;
-#   else
-#       if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
+#   elif defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
        PL_reentrant_buffer->_pwent_size = SIABUFSIZ;
-#       else
-#           ifdef __sgi
+#   elif defined(__sgi)
        PL_reentrant_buffer->_pwent_size = BUFSIZ;
-#           else
+#   else
        PL_reentrant_buffer->_pwent_size = REENTRANTUSUALSIZE;
-#           endif
-#       endif
 #   endif 
 #endif /* HAS_GETPWNAM_R */
 #ifdef HAS_GETSERVBYNAME_R
@@ -116,16 +108,12 @@ Perl_reentrant_size(pTHX) {
        PL_reentrant_buffer->_spent_size = sysconf(_SC_GETPW_R_SIZE_MAX);
        if (PL_reentrant_buffer->_spent_size == (size_t) -1)
                PL_reentrant_buffer->_spent_size = REENTRANTUSUALSIZE;
-#   else
-#       if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
+#   elif defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
        PL_reentrant_buffer->_spent_size = SIABUFSIZ;
-#       else
-#           ifdef __sgi
+#   elif defined(__sgi)
        PL_reentrant_buffer->_spent_size = BUFSIZ;
-#           else
+#   else
        PL_reentrant_buffer->_spent_size = REENTRANTUSUALSIZE;
-#           endif
-#       endif
 #   endif 
 #endif /* HAS_GETSPNAM_R */
 #ifdef HAS_READDIR_R
index 1fc14e2..397f8ed 100644 (file)
@@ -540,16 +540,12 @@ EOF
        PL_reentrant_buffer->$sz = sysconf($sc);
        if (PL_reentrant_buffer->$sz == (size_t) -1)
                PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE;
-#   else
-#       if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
+#   elif defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ)
        PL_reentrant_buffer->$sz = SIABUFSIZ;
-#       else
-#           ifdef __sgi
+#   elif defined(__sgi)
        PL_reentrant_buffer->$sz = BUFSIZ;
-#           else
+#   else
        PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE;
-#           endif
-#       endif
 #   endif 
 EOF
            pushinitfree $genfunc;