From: Nicholas Clark Date: Wed, 21 May 2008 10:31:32 +0000 (+0000) Subject: Replaced the WEXITSTATUS, WIFEXITED, WIFSIGNALED, WIFSTOPPED, WSTOPSIG X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=72bfe1b2b35945ea3c95d9b94ae2908121292236;p=p5sagit%2Fp5-mst-13.2.git Replaced the WEXITSTATUS, WIFEXITED, WIFSIGNALED, WIFSTOPPED, WSTOPSIG and WTERMSIG wrappers with one wrapper using the XS "ALIAS" feature. This gets the shared object size back below the size before the removal of int_macro_int. It looks like there are other space savings to be made this way. p4raw-id: //depot/perl@33897 --- diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index 41d66a6..9c101ce 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -649,26 +649,37 @@ INCLUDE: const-xs.inc int WEXITSTATUS(status) int status - -int -WIFEXITED(status) - int status - -int -WIFSIGNALED(status) - int status - -int -WIFSTOPPED(status) - int status - -int -WSTOPSIG(status) - int status - -int -WTERMSIG(status) - int status + ALIAS: + POSIX::WIFEXITED = 1 + POSIX::WIFSIGNALED = 2 + POSIX::WIFSTOPPED = 3 + POSIX::WSTOPSIG = 4 + POSIX::WTERMSIG = 5 + CODE: + switch(ix) { + case 0: + RETVAL = WEXITSTATUS(status); + break; + case 1: + RETVAL = WIFEXITED(status); + break; + case 2: + RETVAL = WIFSIGNALED(status); + break; + case 3: + RETVAL = WIFSTOPPED(status); + break; + case 4: + RETVAL = WSTOPSIG(status); + break; + case 5: + RETVAL = WTERMSIG(status); + break; + default: + Perl_croak(aTHX_ "Illegal alias %d for POSIX::W*", ix); + } + OUTPUT: + RETVAL int isalnum(charstring)