patch-util_coding_cc 758 B

1234567891011121314151617181920212223242526
  1. $OpenBSD: patch-util_coding_cc,v 1.1 2012/08/21 00:28:34 jmatthew Exp $
  2. Use the endianness #define from port_posix.h
  3. See http://code.google.com/p/leveldb/issues/detail?id=110
  4. --- util/coding.cc.orig Thu Aug 16 12:00:57 2012
  5. +++ util/coding.cc Thu Aug 16 12:01:16 2012
  6. @@ -7,7 +7,7 @@
  7. namespace leveldb {
  8. void EncodeFixed32(char* buf, uint32_t value) {
  9. -#if __BYTE_ORDER == __LITTLE_ENDIAN
  10. +#if PLATFORM_IS_LITTLE_ENDIAN
  11. memcpy(buf, &value, sizeof(value));
  12. #else
  13. buf[0] = value & 0xff;
  14. @@ -18,7 +18,7 @@ void EncodeFixed32(char* buf, uint32_t value) {
  15. }
  16. void EncodeFixed64(char* buf, uint64_t value) {
  17. -#if __BYTE_ORDER == __LITTLE_ENDIAN
  18. +#if PLATFORM_IS_LITTLE_ENDIAN
  19. memcpy(buf, &value, sizeof(value));
  20. #else
  21. buf[0] = value & 0xff;