summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-14 11:20:18 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-14 11:20:18 +0000
commitc185d9cd225b332a13f8e3227b0c30a7996e59e8 (patch)
tree895ca1adc5bec2034bb03bed6e1b9c6a23ca38ea /random.c
parentae2df330bc7662a50bea6385e53d49078592b07e (diff)
merge revision(s) 37593: [Backport #7347]
* random.c (BYTE_ORDER): define using configured WORDS_BIGENDIAN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/random.c b/random.c
index 8fc8697b39..f710286373 100644
--- a/random.c
+++ b/random.c
@@ -1261,6 +1261,19 @@ random_s_rand(int argc, VALUE *argv, VALUE obj)
#define SIP_HASH_STREAMING 0
#define sip_hash24 ruby_sip_hash24
+#if !defined _WIN32 && !defined BYTE_ORDER
+# ifdef WORDS_BIGENDIAN
+# define BYTE_ORDER BIG_ENDIAN
+# else
+# define BYTE_ORDER LITTLE_ENDIAN
+# endif
+# ifndef LITTLE_ENDIAN
+# define LITTLE_ENDIAN 1234
+# endif
+# ifndef BIG_ENDIAN
+# define BIG_ENDIAN 4321
+# endif
+#endif
#include "siphash.c"
static st_index_t hashseed;