Skip to content

Commit 9a80cf1

Browse files
brechtsandersacozzette
authored andcommitted
Update coded_stream.h
Fix for Windows build with MinGW-w64 compiler. Windows is assumed to always be little endian.
1 parent a97c4f4 commit 9a80cf1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/google/protobuf/io/coded_stream.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@
120120
#include <type_traits>
121121
#include <utility>
122122

123-
#ifdef _MSC_VER
123+
#ifdef _WIN32
124124
// Assuming windows is always little-endian.
125125
#if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST)
126126
#define PROTOBUF_LITTLE_ENDIAN 1
127127
#endif
128-
#if _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
128+
#if defined(_MSC_VER) && _MSC_VER >= 1300 && !defined(__INTEL_COMPILER)
129129
// If MSVC has "/RTCc" set, it will complain about truncating casts at
130130
// runtime. This file contains some intentional truncating casts.
131131
#pragma runtime_checks("c", off)

0 commit comments

Comments
 (0)