diff options
-rw-r--r-- | csharp/README.md | 19 | ||||
-rw-r--r-- | src/google/protobuf/stubs/port.h | 7 |
2 files changed, 17 insertions, 9 deletions
diff --git a/csharp/README.md b/csharp/README.md index a798ee62..305c44b6 100644 --- a/csharp/README.md +++ b/csharp/README.md @@ -1,7 +1,7 @@ This directory contains the C# Protocol Buffers runtime library. -Warning: experimental! -====================== +Status: Alpha - ready for early adopters +======================================== This code is still under significant churn. Unlike the original port, it only supports proto3 (but not *all* of proto3 yet) - there are no @@ -12,15 +12,20 @@ reflection. (It's currently exposed publicly, but won't be eventually.) Also unlike the original port, the new version embraces mutability - -there are no builder types. We plan to add "freezing" operations as -well as cloning, however. +there are no builder types. Usage ===== -Use `protoc` with the `--csharp_out` option to generate C# files in the specified directory. -Include these in your C# project, and add a reference to the `Google.Protobuf` project. Currently -there is no NuGet package for this, but we will be building one as soon as the API is stable. +The easiest way how to use C# protobufs is via the `Google.Protobuf` +NuGet package. Just add the NuGet package to your VS project. + +Besides C# runtime library, the NuGet package also contains +precompiled version of `protoc.exe` and a copy of well known `.proto` +files under the package's `tools` directory. + +To generate C# files from your `.proto` files, invoke `protoc` with the +`--csharp_out` option. Supported platforms =================== diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index 5158a6f9..9ea34cde 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -45,12 +45,15 @@ #endif #undef PROTOBUF_LITTLE_ENDIAN -#ifdef _MSC_VER +#ifdef _WIN32 // Assuming windows is always little-endian. + // TODO(xiaofeng): The PROTOBUF_LITTLE_ENDIAN is not only used for + // optimization but also for correctness. We should define an + // different macro to test the big-endian code path in coded_stream. #if !defined(PROTOBUF_DISABLE_LITTLE_ENDIAN_OPT_FOR_TEST) #define PROTOBUF_LITTLE_ENDIAN 1 #endif - #if _MSC_VER >= 1300 + #if defined(_MSC_VER) && _MSC_VER >= 1300 // If MSVC has "/RTCc" set, it will complain about truncating casts at // runtime. This file contains some intentional truncating casts. #pragma runtime_checks("c", off) |