summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/CORE/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/CORE/util.h')
-rw-r--r--Master/tlpkg/tlperl/lib/CORE/util.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/CORE/util.h b/Master/tlpkg/tlperl/lib/CORE/util.h
index ed133c464bd..08544f5600c 100644
--- a/Master/tlpkg/tlperl/lib/CORE/util.h
+++ b/Master/tlpkg/tlperl/lib/CORE/util.h
@@ -52,6 +52,36 @@ This is a synonym for (! foldEQ_locale())
#define ibcmp(s1, s2, len) cBOOL(! foldEQ(s1, s2, len))
#define ibcmp_locale(s1, s2, len) cBOOL(! foldEQ_locale(s1, s2, len))
+/* outside the core, perl.h undefs HAS_QUAD if IV isn't 64-bit
+ We can't swap this to HAS_QUAD, because the logic here affects the type of
+ perl_drand48_t below, and that is visible outside of the core. */
+#if defined(U64TYPE) && !defined(USING_MSVC6)
+/* use a faster implementation when quads are available,
+ * but not with VC6 on Windows */
+# define PERL_DRAND48_QUAD
+#endif
+
+#ifdef PERL_DRAND48_QUAD
+
+/* U64 is only defined under PERL_CORE, but this needs to be visible
+ * elsewhere so the definition of PerlInterpreter is complete.
+ */
+typedef U64TYPE perl_drand48_t;
+
+#else
+
+struct PERL_DRAND48_T {
+ U16 seed[3];
+};
+
+typedef struct PERL_DRAND48_T perl_drand48_t;
+
+#endif
+
+#define PL_RANDOM_STATE_TYPE perl_drand48_t
+
+#define Perl_drand48_init(seed) (Perl_drand48_init_r(&PL_random_state, (seed)))
+#define Perl_drand48() (Perl_drand48_r(&PL_random_state))
/*
* Local variables: