summaryrefslogtreecommitdiffstats
path: root/generic/tclTomMath.h
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-08-29 20:25:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-08-29 20:25:53 (GMT)
commit92a05930af027ff4da788119d0fce0f6169c7a7f (patch)
tree62c861d1863965d739a321113db7b0307c6159cd /generic/tclTomMath.h
parent4264a4f6ab00651ac7bd802a8317a1eb8f52d06e (diff)
parent1ef0babc38bf484a63c5bdcb56bed55f2df1bbab (diff)
downloadtcl-92a05930af027ff4da788119d0fce0f6169c7a7f.zip
tcl-92a05930af027ff4da788119d0fce0f6169c7a7f.tar.gz
tcl-92a05930af027ff4da788119d0fce0f6169c7a7f.tar.bz2
libtommath 1.0.1 rc2, for test purposes only
Diffstat (limited to 'generic/tclTomMath.h')
-rw-r--r--generic/tclTomMath.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h
index 001019c..9391aef 100644
--- a/generic/tclTomMath.h
+++ b/generic/tclTomMath.h
@@ -116,16 +116,16 @@ extern "C" {
typedef mp_digit mp_min_u32;
#endif
-/* platforms that can use a better rand function */
+/* use arc4random on platforms that support it */
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
- #define MP_USE_ALT_RAND 1
+ #define MP_GEN_RANDOM() arc4random()
+ #define MP_GEN_RANDOM_MAX 0xffffffff
#endif
-/* use arc4random on platforms that support it */
-#ifdef MP_USE_ALT_RAND
- #define MP_GEN_RANDOM() arc4random()
-#else
+/* use rand() as fall-back if there's no better rand function */
+#ifndef MP_GEN_RANDOM
#define MP_GEN_RANDOM() rand()
+ #define MP_GEN_RANDOM_MAX RAND_MAX
#endif
#define MP_DIGIT_BIT DIGIT_BIT
@@ -796,7 +796,7 @@ int mp_fwrite(mp_int *a, int radix, FILE *stream);
#endif
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref: HEAD -> release/1.0.1, tag: v1.0.1-rc2 */
+/* git commit: e8c27ba7df0efb90708029115c94d681dfa7812f */
+/* commit time: 2017-08-29 10:48:46 +0200 */