| 1 |
--- perl/ext/B/t/concise-xs.t#42~33829~ 2008-05-15 05:01:42.000000000 -0700
|
| 2 |
+++ perl/ext/B/t/concise-xs.t 2008-05-21 02:18:00.000000000 -0700
|
| 3 |
@@ -180,7 +180,13 @@
|
| 4 |
skip => [qw/ _POSIX_JOB_CONTROL /, # platform varying
|
| 5 |
# Might be XS or imported from Fcntl, depending on your
|
| 6 |
# perl version:
|
| 7 |
- qw / S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG /],
|
| 8 |
+ qw / S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISREG /,
|
| 9 |
+ # Might be XS or AUTOLOADed, depending on your perl
|
| 10 |
+ # version:
|
| 11 |
+ qw /WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED
|
| 12 |
+ WSTOPSIG WTERMSIG/,
|
| 13 |
+ 'int_macro_int', # Removed in POSIX 1.16
|
| 14 |
+ ],
|
| 15 |
perl => [qw/ import croak AUTOLOAD /],
|
| 16 |
|
| 17 |
XS => [qw/ write wctomb wcstombs uname tzset tzname
|
| 18 |
@@ -194,7 +200,7 @@
|
| 19 |
mblen lseek log10 localeconv ldexp lchown
|
| 20 |
isxdigit isupper isspace ispunct isprint
|
| 21 |
islower isgraph isdigit iscntrl isalpha
|
| 22 |
- isalnum int_macro_int getcwd frexp fpathconf
|
| 23 |
+ isalnum getcwd frexp fpathconf
|
| 24 |
fmod floor dup2 dup difftime cuserid ctime
|
| 25 |
ctermid cosh constant close clock ceil
|
| 26 |
bootstrap atan asin asctime acos access abort
|
| 27 |
|
| 28 |
--- perl/ext/POSIX/POSIX.pm#55~33826~ 2008-05-15 04:24:43.000000000 -0700
|
| 29 |
+++ perl/ext/POSIX/POSIX.pm 2008-05-21 02:18:00.000000000 -0700
|
| 30 |
@@ -4,7 +4,7 @@
|
| 31 |
|
| 32 |
our(@ISA, %EXPORT_TAGS, @EXPORT_OK, @EXPORT, $AUTOLOAD, %SIGRT) = ();
|
| 33 |
|
| 34 |
-our $VERSION = "1.15";
|
| 35 |
+our $VERSION = "1.16";
|
| 36 |
|
| 37 |
use AutoLoader;
|
| 38 |
|
| 39 |
@@ -35,10 +35,6 @@
|
| 40 |
|
| 41 |
XSLoader::load 'POSIX', $VERSION;
|
| 42 |
|
| 43 |
-my %NON_CONSTS
|
| 44 |
- = (map {($_,1)} qw(WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED WSTOPSIG
|
| 45 |
- WTERMSIG));
|
| 46 |
-
|
| 47 |
sub AUTOLOAD {
|
| 48 |
no strict;
|
| 49 |
no warnings 'uninitialized';
|
| 50 |
@@ -50,15 +46,9 @@
|
| 51 |
local $! = 0;
|
| 52 |
my $constname = $AUTOLOAD;
|
| 53 |
$constname =~ s/.*:://;
|
| 54 |
- if ($NON_CONSTS{$constname}) {
|
| 55 |
- my ($val, $error) = &int_macro_int($constname, $_[0]);
|
| 56 |
- croak $error if $error;
|
| 57 |
- *$AUTOLOAD = sub { &int_macro_int($constname, $_[0]) };
|
| 58 |
- } else {
|
| 59 |
- my ($error, $val) = constant($constname);
|
| 60 |
- croak $error if $error;
|
| 61 |
- *$AUTOLOAD = sub { $val };
|
| 62 |
- }
|
| 63 |
+ my ($error, $val) = constant($constname);
|
| 64 |
+ croak $error if $error;
|
| 65 |
+ *$AUTOLOAD = sub { $val };
|
| 66 |
|
| 67 |
goto &$AUTOLOAD;
|
| 68 |
}
|
| 69 |
|
| 70 |
--- perl/ext/POSIX/POSIX.xs#151~33826~ 2008-05-15 04:24:43.000000000 -0700
|
| 71 |
+++ perl/ext/POSIX/POSIX.xs 2008-05-21 02:18:00.000000000 -0700
|
| 72 |
@@ -394,116 +394,6 @@
|
| 73 |
|
| 74 |
#include "const-c.inc"
|
| 75 |
|
| 76 |
-/* These were implemented in the old "constant" subroutine. They are actually
|
| 77 |
- macros that take an integer argument and return an integer result. */
|
| 78 |
-static int
|
| 79 |
-int_macro_int (const char *name, STRLEN len, IV *arg_result) {
|
| 80 |
- /* Initially switch on the length of the name. */
|
| 81 |
- /* This code has been edited from a "constant" function generated by:
|
| 82 |
-
|
| 83 |
-use ExtUtils::Constant qw (constant_types C_constant XS_constant);
|
| 84 |
-
|
| 85 |
-my $types = {map {($_, 1)} qw(IV)};
|
| 86 |
-my @names = (qw(WEXITSTATUS WIFEXITED
|
| 87 |
- WIFSIGNALED WIFSTOPPED WSTOPSIG WTERMSIG));
|
| 88 |
-
|
| 89 |
-print constant_types(); # macro defs
|
| 90 |
-foreach (C_constant ("POSIX", 'int_macro_int', 'IV', $types, undef, 5, @names) ) {
|
| 91 |
- print $_, "\n"; # C constant subs
|
| 92 |
-}
|
| 93 |
-print "#### XS Section:\n";
|
| 94 |
-print XS_constant ("POSIX", $types);
|
| 95 |
- */
|
| 96 |
-
|
| 97 |
- switch (len) {
|
| 98 |
- case 8:
|
| 99 |
- /* Names all of length 8. */
|
| 100 |
- /* WSTOPSIG WTERMSIG */
|
| 101 |
- /* Offset 1 gives the best switch position. */
|
| 102 |
- switch (name[1]) {
|
| 103 |
- case 'S':
|
| 104 |
- if (memEQ(name, "WSTOPSIG", 8)) {
|
| 105 |
- /* ^ */
|
| 106 |
-#ifdef WSTOPSIG
|
| 107 |
- int i = *arg_result;
|
| 108 |
- *arg_result = WSTOPSIG(WMUNGE(i));
|
| 109 |
- return PERL_constant_ISIV;
|
| 110 |
-#else
|
| 111 |
- return PERL_constant_NOTDEF;
|
| 112 |
-#endif
|
| 113 |
- }
|
| 114 |
- break;
|
| 115 |
- case 'T':
|
| 116 |
- if (memEQ(name, "WTERMSIG", 8)) {
|
| 117 |
- /* ^ */
|
| 118 |
-#ifdef WTERMSIG
|
| 119 |
- int i = *arg_result;
|
| 120 |
- *arg_result = WTERMSIG(WMUNGE(i));
|
| 121 |
- return PERL_constant_ISIV;
|
| 122 |
-#else
|
| 123 |
- return PERL_constant_NOTDEF;
|
| 124 |
-#endif
|
| 125 |
- }
|
| 126 |
- break;
|
| 127 |
- }
|
| 128 |
- break;
|
| 129 |
- case 9:
|
| 130 |
- if (memEQ(name, "WIFEXITED", 9)) {
|
| 131 |
-#ifdef WIFEXITED
|
| 132 |
- int i = *arg_result;
|
| 133 |
- *arg_result = WIFEXITED(WMUNGE(i));
|
| 134 |
- return PERL_constant_ISIV;
|
| 135 |
-#else
|
| 136 |
- return PERL_constant_NOTDEF;
|
| 137 |
-#endif
|
| 138 |
- }
|
| 139 |
- break;
|
| 140 |
- case 10:
|
| 141 |
- if (memEQ(name, "WIFSTOPPED", 10)) {
|
| 142 |
-#ifdef WIFSTOPPED
|
| 143 |
- int i = *arg_result;
|
| 144 |
- *arg_result = WIFSTOPPED(WMUNGE(i));
|
| 145 |
- return PERL_constant_ISIV;
|
| 146 |
-#else
|
| 147 |
- return PERL_constant_NOTDEF;
|
| 148 |
-#endif
|
| 149 |
- }
|
| 150 |
- break;
|
| 151 |
- case 11:
|
| 152 |
- /* Names all of length 11. */
|
| 153 |
- /* WEXITSTATUS WIFSIGNALED */
|
| 154 |
- /* Offset 1 gives the best switch position. */
|
| 155 |
- switch (name[1]) {
|
| 156 |
- case 'E':
|
| 157 |
- if (memEQ(name, "WEXITSTATUS", 11)) {
|
| 158 |
- /* ^ */
|
| 159 |
-#ifdef WEXITSTATUS
|
| 160 |
- int i = *arg_result;
|
| 161 |
- *arg_result = WEXITSTATUS(WMUNGE(i));
|
| 162 |
- return PERL_constant_ISIV;
|
| 163 |
-#else
|
| 164 |
- return PERL_constant_NOTDEF;
|
| 165 |
-#endif
|
| 166 |
- }
|
| 167 |
- break;
|
| 168 |
- case 'I':
|
| 169 |
- if (memEQ(name, "WIFSIGNALED", 11)) {
|
| 170 |
- /* ^ */
|
| 171 |
-#ifdef WIFSIGNALED
|
| 172 |
- int i = *arg_result;
|
| 173 |
- *arg_result = WIFSIGNALED(WMUNGE(i));
|
| 174 |
- return PERL_constant_ISIV;
|
| 175 |
-#else
|
| 176 |
- return PERL_constant_NOTDEF;
|
| 177 |
-#endif
|
| 178 |
- }
|
| 179 |
- break;
|
| 180 |
- }
|
| 181 |
- break;
|
| 182 |
- }
|
| 183 |
- return PERL_constant_NOTFOUND;
|
| 184 |
-}
|
| 185 |
-
|
| 186 |
static void
|
| 187 |
restore_sigmask(pTHX_ SV *osset_sv)
|
| 188 |
{
|
| 189 |
@@ -756,47 +646,29 @@
|
| 190 |
|
| 191 |
INCLUDE: const-xs.inc
|
| 192 |
|
| 193 |
-void
|
| 194 |
-int_macro_int(sv, iv)
|
| 195 |
- PREINIT:
|
| 196 |
- dXSTARG;
|
| 197 |
- STRLEN len;
|
| 198 |
- int type;
|
| 199 |
- INPUT:
|
| 200 |
- SV * sv;
|
| 201 |
- const char * s = SvPV(sv, len);
|
| 202 |
- IV iv;
|
| 203 |
- PPCODE:
|
| 204 |
- /* Change this to int_macro_int(s, len, &iv, &nv);
|
| 205 |
- if you need to return both NVs and IVs */
|
| 206 |
- type = int_macro_int(s, len, &iv);
|
| 207 |
- /* Return 1 or 2 items. First is error message, or undef if no error.
|
| 208 |
- Second, if present, is found value */
|
| 209 |
- switch (type) {
|
| 210 |
- case PERL_constant_NOTFOUND:
|
| 211 |
- sv = sv_2mortal(newSVpvf("%s is not a valid POSIX macro", s));
|
| 212 |
- EXTEND(SP, 1);
|
| 213 |
- PUSHs(&PL_sv_undef);
|
| 214 |
- PUSHs(sv);
|
| 215 |
- break;
|
| 216 |
- case PERL_constant_NOTDEF:
|
| 217 |
- sv = sv_2mortal(newSVpvf(
|
| 218 |
- "Your vendor has not defined POSIX macro %s, used", s));
|
| 219 |
- EXTEND(SP, 1);
|
| 220 |
- PUSHs(&PL_sv_undef);
|
| 221 |
- PUSHs(sv);
|
| 222 |
- break;
|
| 223 |
- case PERL_constant_ISIV:
|
| 224 |
- PUSHi(iv);
|
| 225 |
- break;
|
| 226 |
- default:
|
| 227 |
- sv = sv_2mortal(newSVpvf(
|
| 228 |
- "Unexpected return type %d while processing POSIX macro %s, used",
|
| 229 |
- type, s));
|
| 230 |
- EXTEND(SP, 1);
|
| 231 |
- PUSHs(&PL_sv_undef);
|
| 232 |
- PUSHs(sv);
|
| 233 |
- }
|
| 234 |
+int
|
| 235 |
+WEXITSTATUS(status)
|
| 236 |
+ int status
|
| 237 |
+
|
| 238 |
+int
|
| 239 |
+WIFEXITED(status)
|
| 240 |
+ int status
|
| 241 |
+
|
| 242 |
+int
|
| 243 |
+WIFSIGNALED(status)
|
| 244 |
+ int status
|
| 245 |
+
|
| 246 |
+int
|
| 247 |
+WIFSTOPPED(status)
|
| 248 |
+ int status
|
| 249 |
+
|
| 250 |
+int
|
| 251 |
+WSTOPSIG(status)
|
| 252 |
+ int status
|
| 253 |
+
|
| 254 |
+int
|
| 255 |
+WTERMSIG(status)
|
| 256 |
+ int status
|
| 257 |
|
| 258 |
int
|
| 259 |
isalnum(charstring)
|
| 260 |
|
| 261 |
|