ESUCCESS = 0 is not true, but exists.
[p5sagit/p5-mst-13.2.git] / perl.h
diff --git a/perl.h b/perl.h
index 49bdb0a..46ce72b 100644 (file)
--- a/perl.h
+++ b/perl.h
 
 /* Use the reentrant APIs like localtime_r and getpwent_r */
 /* Win32 has naturally threadsafe libraries, no need to use any _r variants. */
-#if defined(USE_ITHREADS) && !defined(USE_REENTRANT_API) && !defined(NETWARE) && !defined(WIN32) && !defined(DARWIN)
+#if defined(USE_ITHREADS) && !defined(USE_REENTRANT_API) && !defined(NETWARE) && !defined(WIN32) && !defined(PERL_DARWIN)
 #   define USE_REENTRANT_API
 #endif
 
 /* <--- here ends the logic shared by perl.h and makedef.pl */
 
 /*
- * DARWIN for MacOSX (__APPLE__ exists but is not officially sanctioned)
- * (The -DDARWIN comes from the hints/darwin.sh.)
+ * PERL_DARWIN for MacOSX (__APPLE__ exists but is not officially sanctioned)
+ * (The -DPERL_DARWIN comes from the hints/darwin.sh.)
  * __bsdi__ for BSD/OS
  */
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(DARWIN) || defined(__bsdi__) || defined(BSD41) || defined(BSD42) || defined(BSD43) || defined(BSD44)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(PERL_DARWIN) || defined(__bsdi__) || defined(BSD41) || defined(BSD42) || defined(BSD43) || defined(BSD44)
 #   ifndef BSDish
 #       define BSDish
 #   endif
@@ -499,7 +499,7 @@ int usleep(unsigned int);
                  panic_write2("panic: tainting with $ENV{PERL_MALLOC_OPT}\n");\
                  exit(1); })
 #  define MALLOC_CHECK_TAINT(argc,argv,env)    STMT_START {    \
-       if (PL_earlytaint) {                                    \
+       if (doing_taint(argc,argv,env)) {                       \
                MallocCfg_ptr[MallocCfg_skip_cfg_env] = 1;      \
     }} STMT_END;
 #else  /* MYMALLOC */
@@ -672,9 +672,12 @@ int usleep(unsigned int);
 #  define WIN32SCK_IS_STDSCK           /* don't pull in custom wsock layer */
 #endif
 
-/* In Tru64 use the 4.4BSD struct msghdr, not the 4.3 one */
-#if defined(__osf__) && defined(__alpha) && !defined(_SOCKADDR_LEN)
-#  define _SOCKADDR_LEN
+/* In Tru64 use the 4.4BSD struct msghdr, not the 4.3 one.
+ * This is important for using IPv6. 
+ * For OSF/1 3.2, however, defining _SOCKADDR_LEN would be
+ * a bad idea since it breaks send() and recv(). */
+#if defined(__osf__) && defined(__alpha) && !defined(_SOCKADDR_LEN) && !defined(DEC_OSF1_3_X)
+#   define _SOCKADDR_LEN
 #endif
 
 #if defined(HAS_SOCKET) && !defined(VMS) && !defined(WIN32) /* VMS/WIN32 handle sockets via vmsish.h/win32.h */
@@ -1935,28 +1938,17 @@ typedef struct clone_params CLONE_PARAMS;
 #    define PERL_FPU_INIT fpsetmask(0);
 #  else
 #    if defined(SIGFPE) && defined(SIG_IGN)
-#      define PERL_FPU_INIT signal(SIGFPE, SIG_IGN);
+#      define PERL_FPU_INIT       PL_sigfpe_saved = signal(SIGFPE, SIG_IGN);
+#      define PERL_FPU_PRE_EXEC   { Sigsave_t xfpe; rsignal_save(SIGFPE, PL_sigfpe_saved, &xfpe);
+#      define PERL_FPU_POST_EXEC    rsignal_restore(SIGFPE, &xfpe); }
 #    else
 #      define PERL_FPU_INIT
 #    endif
 #  endif
 #endif
-
-/* The PL_earlytaint is to be used instead PL_tainting before
- * perl_parse() has had the chance to set up PL_tainting. */
-
-#ifndef EARLY_INIT3
-#  define EARLY_INIT3(argvp,argcp,envp) \
-       STMT_START {            \
-               PL_earlytaint = doing_taint(argcp, argvp, envp); \
-       } STMT_END;
-#endif
-
-#ifndef EARLY_INIT2
-#  define EARLY_INIT2(argvp,argcp) \
-       STMT_START {            \
-               PL_earlytaint = doing_taint(argcp, argvp, 0); \
-       } STMT_END;
+#ifndef PERL_FPU_PRE_EXEC
+#  define PERL_FPU_PRE_EXEC   {
+#  define PERL_FPU_POST_EXEC  }
 #endif
 
 #ifndef PERL_SYS_INIT3
@@ -2267,7 +2259,12 @@ typedef        struct crypt_data {     /* straight from /usr/include/crypt.h */
 #  include "iperlsys.h"
 #endif
 
-/* [perl #22371] Algorimic Complexity Attack on Perl 5.6.1, 5.8.0 */
+/* [perl #22371] Algorimic Complexity Attack on Perl 5.6.1, 5.8.0.
+ * Note that the USE_HASH_SEED and USE_HASH_SEED_EXPLICIT are *NOT*
+ * defined by Configure, despite their names being similar to the
+ * other defines like USE_ITHREADS.  Configure in fact knows nothing
+ * about the randomised hashes.  Therefore to enable/disable the hash
+ * randomisation defines use the Configure -Accflags=... instead. */
 #if !defined(NO_HASH_SEED) && !defined(USE_HASH_SEED) && !defined(USE_HASH_SEED_EXPLICIT)
 #  define USE_HASH_SEED
 #endif
@@ -2556,8 +2553,8 @@ Gid_t getegid (void);
 #  define DEBUG_v_TEST DEBUG_v_TEST_
 #  define DEBUG_C_TEST DEBUG_C_TEST_
 
-#  define DEB(a)     a
-#  define DEBUG(a)   if (PL_debug)   a
+#  define PERL_DEB(a)                  a
+#  define PERL_DEBUG(a) if (PL_debug)  a
 #  define DEBUG_p(a) if (DEBUG_p_TEST) a
 #  define DEBUG_s(a) if (DEBUG_s_TEST) a
 #  define DEBUG_l(a) if (DEBUG_l_TEST) a
@@ -2619,8 +2616,8 @@ Gid_t getegid (void);
 #  define DEBUG_v_TEST (0)
 #  define DEBUG_C_TEST (0)
 
-#  define DEB(a)
-#  define DEBUG(a)
+#  define PERL_DEB(a)
+#  define PERL_DEBUG(a)
 #  define DEBUG_p(a)
 #  define DEBUG_s(a)
 #  define DEBUG_l(a)
@@ -2707,14 +2704,14 @@ Gid_t getegid (void);
 
 #ifndef assert  /* <assert.h> might have been included somehow */
 #ifdef DEBUGGING
-#define assert(what)   DEB( {                                          \
+#define assert(what)   PERL_DEB( {                                     \
        if (!(what)) {                                                  \
            Perl_croak(aTHX_ "Assertion " STRINGIFY(what) " failed: file \"%s\", line %d",      \
                __FILE__, __LINE__);                                    \
            PerlProc_exit(1);                                           \
        }})
 #else
-#define assert(what)   DEB( {                                          \
+#define assert(what)   PERL_DEB( {                                     \
        if (!(what)) {                                                  \
            Perl_croak(aTHX_ "Assertion failed: file \"%s\", line %d",  \
                __FILE__, __LINE__);                                    \
@@ -2950,13 +2947,13 @@ typedef OP* (CPERLscope(*PPADDR_t)[]) (pTHX);
 
 /* NeXT has problems with crt0.o globals */
 #if defined(__DYNAMIC__) && \
-    (defined(NeXT) || defined(__NeXT__) || defined(DARWIN))
+    (defined(NeXT) || defined(__NeXT__) || defined(PERL_DARWIN))
 #  if defined(NeXT) || defined(__NeXT)
 #    include <mach-o/dyld.h>
 #    define environ (*environ_pointer)
 EXT char *** environ_pointer;
 #  else
-#    if defined(DARWIN) && defined(PERL_CORE)
+#    if defined(PERL_DARWIN) && defined(PERL_CORE)
 #      include <crt_externs.h> /* for the env array */
 #      define environ (*_NSGetEnviron())
 #    endif
@@ -4371,7 +4368,6 @@ extern void moncontrol(int);
 
    HAS_UALARM
    HAS_USLEEP
-   HAS_NANOSLEEP
 
    HAS_SETITIMER
    HAS_GETITIMER