From 224010c7759f0ca78c01df40a48fe0653cab8aca Mon Sep 17 00:00:00 2001 From: LitingLin Date: Thu, 30 Jul 2015 01:51:11 +0800 Subject: [PATCH 1/2] A bug about PROTOBUF_LITTLE_ENDIAN remain undefined on MSVC x64 --- src/google/protobuf/io/coded_stream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h index 961c1a3f..a20f4445 100644 --- a/src/google/protobuf/io/coded_stream.h +++ b/src/google/protobuf/io/coded_stream.h @@ -112,7 +112,7 @@ #include #include #ifdef _MSC_VER - #if defined(_M_IX86) && \ + #if (defined(_M_IX86) || defined(_M_AMD64)) && \ !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) #define PROTOBUF_LITTLE_ENDIAN 1 #endif From 67d51ac4f8be7ad3efec48da20317131c89cd903 Mon Sep 17 00:00:00 2001 From: LitingLin Date: Thu, 30 Jul 2015 02:35:39 +0800 Subject: [PATCH 2/2] Windows is always little-endian. --- src/google/protobuf/io/coded_stream.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h index a20f4445..ad351dc3 100644 --- a/src/google/protobuf/io/coded_stream.h +++ b/src/google/protobuf/io/coded_stream.h @@ -112,8 +112,8 @@ #include #include #ifdef _MSC_VER - #if (defined(_M_IX86) || defined(_M_AMD64)) && \ - !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) + // Assuming windows is always little-endian. + #if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) #define PROTOBUF_LITTLE_ENDIAN 1 #endif #if _MSC_VER >= 1300