Index: src/google/protobuf/io/coded_stream.h
===================================================================
--- src/google/protobuf/io/coded_stream.h	(revision 323)
+++ src/google/protobuf/io/coded_stream.h	(working copy)
@@ -112,6 +112,10 @@
 #include <string>
 #ifndef _MSC_VER
 #include <sys/param.h>
+#elif _MSC_VER >= 1300 // _MSC_VER
+  // If Visual C++ compiler has "/RTCc" set, it will complain about
+  // this below at runtime unless we mask off the bits we don't care about.
+  #pragma runtime_checks( "c", off )
 #endif  // !_MSC_VER
 #include <google/protobuf/stubs/common.h>
 #include <google/protobuf/stubs/common.h>          // for GOOGLE_PREDICT_TRUE macro
@@ -1087,4 +1091,10 @@
 }  // namespace protobuf
 
 }  // namespace google
+
+
+#if defined(_MSC_VER) && _MSC_VER >= 1300
+  #pragma runtime_checks( "c", restore )
+#endif  // _MSC_VER
+
 #endif  // GOOGLE_PROTOBUF_IO_CODED_STREAM_H__
Index: src/google/protobuf/stubs/common.h
===================================================================
--- src/google/protobuf/stubs/common.h	(revision 323)
+++ src/google/protobuf/stubs/common.h	(working copy)
@@ -93,9 +93,16 @@
   #define LIBPROTOBUF_EXPORT
   #define LIBPROTOC_EXPORT
 #endif
+ 
 
-namespace internal {
+// __BYTE_ORDER is not defined on Windows, so set it here:
+#if defined(_MSC_VER) && !defined(__BYTE_ORDER) && defined(_M_IX86)
+  #define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
 
+
+ namespace internal {
+
 // Some of these constants are macros rather than const ints so that they can
 // be used in #if directives.
 
