mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
random.c: BYTE_ORDER
* random.c (BYTE_ORDER): define using configured WORDS_BIGENDIAN. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1d2ddae160
commit
2ce1fbeb59
2 changed files with 16 additions and 1 deletions
|
@ -1,4 +1,6 @@
|
||||||
Fri Nov 9 23:02:25 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Nov 9 23:05:06 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* random.c (BYTE_ORDER): define using configured WORDS_BIGENDIAN.
|
||||||
|
|
||||||
* siphash.c (sip_init_state): use union to suppress warnings by gcc
|
* siphash.c (sip_init_state): use union to suppress warnings by gcc
|
||||||
4.7.
|
4.7.
|
||||||
|
|
13
random.c
13
random.c
|
@ -1328,6 +1328,19 @@ random_s_rand(int argc, VALUE *argv, VALUE obj)
|
||||||
|
|
||||||
#define SIP_HASH_STREAMING 0
|
#define SIP_HASH_STREAMING 0
|
||||||
#define sip_hash24 ruby_sip_hash24
|
#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"
|
#include "siphash.c"
|
||||||
|
|
||||||
static st_index_t hashseed;
|
static st_index_t hashseed;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue