# endif
#endif /* !HAS_BCMP */
+/* In Tru64 define _SOCKADDR_LEN to use 4.4BSD and IPv6 interfaces.
+ * Define it before any network headers like netinet/in.h or sys/socket.h.
+ * 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
+
#ifdef I_NETINET_IN
# include <netinet/in.h>
#endif
# 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.
- * 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(WIN32) /* WIN32 handles sockets via win32.h */
# include <sys/socket.h>
# if defined(USE_SOCKS) && defined(I_SOCKS)
# include <ieeefp.h>
#endif
+#ifdef USING_MSVC6
+/* VC6 has broken NaN semantics: NaN == NaN returns true instead of false,
+ * and for example NaN < IV_MIN. */
+# define NAN_COMPARE_BROKEN
+#endif
+#if defined(__DECC) && defined(__osf__)
+/* Also Tru64 cc has broken NaN comparisons. */
+# define NAN_COMPARE_BROKEN
+#endif
+
#ifdef USE_LONG_DOUBLE
# ifdef I_SUNMATH
# include <sunmath.h>
# ifndef Perl_isinf
# if defined(HAS_ISINFL) && !(defined(isinf) && defined(HAS_C99))
# define Perl_isinf(x) isinfl(x)
-# elif defined(LDBL_MAX)
+# elif defined(LDBL_MAX) && !defined(NAN_COMPARE_BROKEN)
# define Perl_isinf(x) ((x) > LDBL_MAX || (x) < -LDBL_MAX)
# endif
# endif
# ifndef Perl_isinf
# if defined(HAS_ISINF)
# define Perl_isinf(x) isinf(x)
-# elif defined(DBL_MAX)
+# elif defined(DBL_MAX) && !defined(NAN_COMPARE_BROKEN)
# define Perl_isinf(x) ((x) > DBL_MAX || (x) < -DBL_MAX)
# endif
# endif
typedef struct padop PADOP;
typedef struct pvop PVOP;
typedef struct loop LOOP;
+typedef struct methop METHOP;
#ifdef PERL_CORE
typedef struct opslab OPSLAB;
# define PERL_SAWAMPERSAND
#endif
+#if defined(PERL_DEBUG_READONLY_OPS) && !defined(USE_ITHREADS)
+# error PERL_DEBUG_READONLY_OPS only works with ithreads
+#endif
+
#include "handy.h"
#if defined(USE_LARGE_FILES) && !defined(NO_64_BIT_RAWIO)
# define PERL_FPU_POST_EXEC }
#endif
+/* In Tru64 the cc -ieee enables the IEEE math but disables traps.
+ * We need to reenable the "invalid" trap because otherwise generation
+ * of NaN values leaves the IEEE fp flags in bad state, leaving any further
+ * fp ops behaving strangely (Inf + 1 resulting in zero, for example). */
+#ifdef __osf__
+# include <machine/fpu.h>
+# define PERL_SYS_FPU_INIT \
+ STMT_START { \
+ ieee_set_fp_control(IEEE_TRAP_ENABLE_INV); \
+ signal(SIGFPE, SIG_IGN); \
+ } STMT_END
+#endif
+
+#ifndef PERL_SYS_FPU_INIT
+# define PERL_SYS_FPU_INIT NOOP
+#endif
+
#ifndef PERL_SYS_INIT3_BODY
# define PERL_SYS_INIT3_BODY(argvp,argcp,envp) PERL_SYS_INIT_BODY(argvp,argcp)
#endif
EXTCONST char PL_no_func[]
INIT("The %s function is unimplemented");
EXTCONST char PL_no_myglob[]
- INIT("\"%s\" variable %s can't be in a package");
+ INIT("\"%s\" %se %s can't be in a package");
EXTCONST char PL_no_localize_ref[]
INIT("Can't localize through a reference");
EXTCONST char PL_memory_wrap[]