add support for STASH and MAGIC information for REFs to sv_dump().
[p5sagit/p5-mst-13.2.git] / ext / POSIX / POSIX.xs
index 2d1abf3..9a4fc02 100644 (file)
@@ -1,9 +1,5 @@
 #define PERL_EXT_POSIX
 
-#ifdef WIN32
-#define _POSIX_
-#endif
-
 #ifdef NETWARE
        #define _POSIX_
        /*
@@ -457,7 +453,8 @@ __END__
       if (memEQ(name, "WSTOPSIG", 8)) {
       /*                  ^          */
 #ifdef WSTOPSIG
-        *arg_result = WSTOPSIG(WMUNGE(*arg_result));
+        int i = *arg_result;
+        *arg_result = WSTOPSIG(WMUNGE(i));
         return PERL_constant_ISIV;
 #else
         return PERL_constant_NOTDEF;
@@ -468,7 +465,8 @@ __END__
       if (memEQ(name, "WTERMSIG", 8)) {
       /*                  ^          */
 #ifdef WTERMSIG
-        *arg_result = WTERMSIG(WMUNGE(*arg_result));
+        int i = *arg_result;
+        *arg_result = WTERMSIG(WMUNGE(i));
         return PERL_constant_ISIV;
 #else
         return PERL_constant_NOTDEF;
@@ -491,7 +489,8 @@ __END__
   case 9:
     if (memEQ(name, "WIFEXITED", 9)) {
 #ifdef WIFEXITED
-      *arg_result = WIFEXITED(WMUNGE(*arg_result));
+      int i = *arg_result;
+      *arg_result = WIFEXITED(WMUNGE(i));
       return PERL_constant_ISIV;
 #else
       return PERL_constant_NOTDEF;
@@ -501,7 +500,8 @@ __END__
   case 10:
     if (memEQ(name, "WIFSTOPPED", 10)) {
 #ifdef WIFSTOPPED
-      *arg_result = WIFSTOPPED(WMUNGE(*arg_result));
+      int i = *arg_result;
+      *arg_result = WIFSTOPPED(WMUNGE(i));
       return PERL_constant_ISIV;
 #else
       return PERL_constant_NOTDEF;
@@ -517,7 +517,8 @@ __END__
       if (memEQ(name, "WEXITSTATUS", 11)) {
       /*                ^                */
 #ifdef WEXITSTATUS
-        *arg_result = WEXITSTATUS(WMUNGE(*arg_result));
+       int i = *arg_result;
+        *arg_result = WEXITSTATUS(WMUNGE(i));
         return PERL_constant_ISIV;
 #else
         return PERL_constant_NOTDEF;
@@ -528,7 +529,8 @@ __END__
       if (memEQ(name, "WIFSIGNALED", 11)) {
       /*                ^                */
 #ifdef WIFSIGNALED
-        *arg_result = WIFSIGNALED(WMUNGE(*arg_result));
+       int i = *arg_result;
+        *arg_result = WIFSIGNALED(WMUNGE(i));
         return PERL_constant_ISIV;
 #else
         return PERL_constant_NOTDEF;
@@ -841,7 +843,7 @@ isalnum(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!isalnum(*s))
                RETVAL = 0;
@@ -853,7 +855,7 @@ isalpha(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!isalpha(*s))
                RETVAL = 0;
@@ -865,7 +867,7 @@ iscntrl(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!iscntrl(*s))
                RETVAL = 0;
@@ -877,7 +879,7 @@ isdigit(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!isdigit(*s))
                RETVAL = 0;
@@ -889,7 +891,7 @@ isgraph(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!isgraph(*s))
                RETVAL = 0;
@@ -901,7 +903,7 @@ islower(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!islower(*s))
                RETVAL = 0;
@@ -913,7 +915,7 @@ isprint(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!isprint(*s))
                RETVAL = 0;
@@ -925,7 +927,7 @@ ispunct(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!ispunct(*s))
                RETVAL = 0;
@@ -937,7 +939,7 @@ isspace(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!isspace(*s))
                RETVAL = 0;
@@ -949,7 +951,7 @@ isupper(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!isupper(*s))
                RETVAL = 0;
@@ -961,7 +963,7 @@ isxdigit(charstring)
        unsigned char * charstring
     CODE:
        unsigned char *s = charstring;
-       unsigned char *e = s + PL_na;   /* "PL_na" set by typemap side effect */
+       unsigned char *e = s + SvCUR(ST(0));
        for (RETVAL = 1; RETVAL && s < e; s++)
            if (!isxdigit(*s))
                RETVAL = 0;