Skip to content

Commit

Permalink
Merge pull request #75 from estolfo/fix-constant-def
Browse files Browse the repository at this point in the history
RUBY-1173 Move BSON_BYTE_ORDER definition back to original location
  • Loading branch information
estolfo authored Dec 15, 2016
2 parents 192d527 + 3d01d68 commit 7832c9b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions ext/bson/native-endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@
#define BSON_BIG_ENDIAN 4321
#define BSON_LITTLE_ENDIAN 1234

/* See a similar check in ruby's sha2.h */
# ifndef BSON_BYTE_ORDER
# ifdef WORDS_BIGENDIAN
# define BSON_BYTE_ORDER BSON_BIG_ENDIAN
# else
# define BSON_BYTE_ORDER BSON_LITTLE_ENDIAN
# endif
# endif /* BSON_BYTE_ORDER */


#if defined(__sun)
# include <sys/byteorder.h>
# if defined(_LITTLE_ENDIAN)
Expand All @@ -45,6 +35,15 @@
# endif
#endif

/* See a similar check in ruby's sha2.h */
# ifndef BSON_BYTE_ORDER
# ifdef WORDS_BIGENDIAN
# define BSON_BYTE_ORDER BSON_BIG_ENDIAN
# else
# define BSON_BYTE_ORDER BSON_LITTLE_ENDIAN
# endif
# endif /* BSON_BYTE_ORDER */

#if defined(__sun)
# define BSON_UINT16_SWAP_LE_BE(v) __bson_uint16_swap_slow((uint16_t)v)
# define BSON_UINT32_SWAP_LE_BE(v) __bson_uint32_swap_slow((uint32_t)v)
Expand Down

0 comments on commit 7832c9b

Please sign in to comment.