MPE/iX tweaks from Mark Bixby.
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index 5bd891c..1673da9 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -258,6 +258,15 @@ struct perl_thread;
 #  define dTHXx                dTHX
 #endif
 
+/* Under PERL_IMPLICIT_SYS (used in Windows for fork emulation)
+ * PerlIO_foo() expands to PL_StdIO->pFOO(PL_StdIO, ...).
+ * dTHXs is therefore needed for all functions using PerlIO_foo(). */
+#ifdef PERL_IMPLICIT_SYS
+#  define dTHXs                dTHX
+#else
+#  define dTHXs                dNOOP
+#endif
+
 #undef START_EXTERN_C
 #undef END_EXTERN_C
 #undef EXTERN_C
@@ -506,12 +515,12 @@ register struct op *Perl_op asm(stringify(OP_IN_REGISTER));
 #   include <unistd.h>
 #endif
 
-#ifndef HAS_SYSCALL_PROTO
+#if defined(HAS_SYSCALL) && !defined(HAS_SYSCALL_PROTO)
 int syscall(int, ...);
 #endif
 
-#ifndef HAS_USLEEP_PROTO
-int usleep(unsigned);
+#if defined(HAS_USLEEP) && !defined(HAS_USLEEP_PROTO)
+int usleep(unsigned int);
 #endif
 
 #ifdef PERL_MICRO /* Last chance to export Perl_my_swap */
@@ -765,9 +774,9 @@ typedef struct perl_mstats perl_mstats_t;
 # endif
 #endif
 
-/* sockatmark() is so new that many places might have it hidden
+/* sockatmark() is so new (2001) that many places might have it hidden
  * behind some -D_BLAH_BLAH_SOURCE guard. */
-#ifndef HAS_SOCKATMARK_PROTO
+#if defined(HAS_SOCKATMARK) && !defined(HAS_SOCKATMARK_PROTO)
 int sockatmark(int);
 #endif
 
@@ -2485,10 +2494,12 @@ I32 unlnk (char*);
 #define UNLINK PerlLIO_unlink
 #endif
 
-#ifndef HAS_SETRESUID_PROTO /* some versions of glibc */
+/* some versions of glibc are missing the setresuid() proto */
+#if defined(HAS_SETRESUID) && !defined(HAS_SETRESUID_PROTO)
 int setresuid(uid_t ruid, uid_t euid, uid_t suid);
 #endif
-#ifndef HAS_SETRESGID_PROTO /* some versions of glibc */
+/* some versions of glibc are missing the setresgid() proto */
+#if defined(HAS_SETRESGID) && !defined(HAS_SETRESGID_PROTO)
 int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
 #endif
 
@@ -3448,12 +3459,6 @@ typedef struct am_table_short AMTS;
 #define IN_LOCALE \
        (PL_curcop == &PL_compiling ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
 
-#define IS_NUMERIC_RADIX(s, send)      \
-       (PL_numeric_radix_sv \
-        && IN_LOCALE \
-        && SvCUR(PL_numeric_radix_sv) <= ((send)-(s)) \
-        && memEQ(s, SvPVX(PL_numeric_radix_sv), SvCUR(PL_numeric_radix_sv)))
-
 #define STORE_NUMERIC_LOCAL_SET_STANDARD() \
        bool was_local = PL_numeric_local && IN_LOCALE; \
        if (was_local) SET_NUMERIC_STANDARD();
@@ -3657,7 +3662,7 @@ typedef struct am_table_short AMTS;
 #  include <sys/file.h>
 #endif
 
-#ifndef HAS_FLOCK_PROTO
+#if defined(HAS_FLOCK) && !defined(HAS_FLOCK_PROTO)
 int flock(int fd, int op);
 #endif
 
@@ -3730,6 +3735,16 @@ int flock(int fd, int op);
 #define EXEC_ARGV_CAST(x) x
 #endif
 
+#define IS_NUMBER_IN_UV                      0x01 /* number within UV range (maybe not
+                                             int).  value returned in pointed-
+                                             to UV */
+#define IS_NUMBER_GREATER_THAN_UV_MAX 0x02 /* pointed to UV undefined */
+#define IS_NUMBER_NOT_INT            0x04 /* saw . or E notation */
+#define IS_NUMBER_NEG                0x08 /* leading minus sign */
+#define IS_NUMBER_INFINITY           0x10 /* this is big */
+
+#define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
+
 /* and finally... */
 #define PERL_PATCHLEVEL_H_IMPLICIT
 #include "patchlevel.h"