| Index: third_party/protobuf/patches/0004-fix-integer-types-and-shared-library-exports.patch
|
| diff --git a/third_party/protobuf/patches/0004-fix-integer-types-and-shared-library-exports.patch b/third_party/protobuf/patches/0004-fix-integer-types-and-shared-library-exports.patch
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..084555332f3d60b7520813be04ef98f5ae446ac1
|
| --- /dev/null
|
| +++ b/third_party/protobuf/patches/0004-fix-integer-types-and-shared-library-exports.patch
|
| @@ -0,0 +1,84 @@
|
| +--- protobuf-cleaned/src/google/protobuf/stubs/port.h 2015-12-30 13:21:46.000000000 -0800
|
| ++++ protobuf-patched/src/google/protobuf/stubs/port.h 2016-03-31 13:25:26.840024811 -0700
|
| +@@ -66,18 +66,34 @@
|
| + #define PROTOBUF_LITTLE_ENDIAN 1
|
| + #endif
|
| + #endif
|
| +-#if defined(_MSC_VER) && defined(PROTOBUF_USE_DLLS)
|
| +- #ifdef LIBPROTOBUF_EXPORTS
|
| +- #define LIBPROTOBUF_EXPORT __declspec(dllexport)
|
| +- #else
|
| +- #define LIBPROTOBUF_EXPORT __declspec(dllimport)
|
| +- #endif
|
| +- #ifdef LIBPROTOC_EXPORTS
|
| +- #define LIBPROTOC_EXPORT __declspec(dllexport)
|
| +- #else
|
| +- #define LIBPROTOC_EXPORT __declspec(dllimport)
|
| ++
|
| ++// The macros defined below are required in order to make protobuf_lite a
|
| ++// component on all platforms. See http://crbug.com/172800.
|
| ++#if defined(COMPONENT_BUILD) && defined(PROTOBUF_USE_DLLS)
|
| ++ #if defined(_MSC_VER)
|
| ++ #ifdef LIBPROTOBUF_EXPORTS
|
| ++ #define LIBPROTOBUF_EXPORT __declspec(dllexport)
|
| ++ #else
|
| ++ #define LIBPROTOBUF_EXPORT __declspec(dllimport)
|
| ++ #endif
|
| ++ #ifdef LIBPROTOC_EXPORTS
|
| ++ #define LIBPROTOC_EXPORT __declspec(dllexport)
|
| ++ #else
|
| ++ #define LIBPROTOC_EXPORT __declspec(dllimport)
|
| ++ #endif
|
| ++ #else // defined(_MSC_VER)
|
| ++ #ifdef LIBPROTOBUF_EXPORTS
|
| ++ #define LIBPROTOBUF_EXPORT __attribute__((visibility("default")))
|
| ++ #else
|
| ++ #define LIBPROTOBUF_EXPORT
|
| ++ #endif
|
| ++ #ifdef LIBPROTOC_EXPORTS
|
| ++ #define LIBPROTOC_EXPORT __attribute__((visibility("default")))
|
| ++ #else
|
| ++ #define LIBPROTOC_EXPORT
|
| ++ #endif
|
| + #endif
|
| +-#else
|
| ++#else // defined(COMPONENT_BUILD) && defined(PROTOBUF_USE_DLLS)
|
| + #define LIBPROTOBUF_EXPORT
|
| + #define LIBPROTOC_EXPORT
|
| + #endif
|
| +@@ -109,15 +125,15 @@
|
| + typedef unsigned __int32 uint32;
|
| + typedef unsigned __int64 uint64;
|
| + #else
|
| +-typedef signed char int8;
|
| +-typedef short int16;
|
| +-typedef int int32;
|
| +-typedef long long int64;
|
| +-
|
| +-typedef unsigned char uint8;
|
| +-typedef unsigned short uint16;
|
| +-typedef unsigned int uint32;
|
| +-typedef unsigned long long uint64;
|
| ++typedef int8_t int8;
|
| ++typedef int16_t int16;
|
| ++typedef int32_t int32;
|
| ++typedef int64_t int64;
|
| ++
|
| ++typedef uint8_t uint8;
|
| ++typedef uint16_t uint16;
|
| ++typedef uint32_t uint32;
|
| ++typedef uint64_t uint64;
|
| + #endif
|
| +
|
| + // long long macros to be used because gcc and vc++ use different suffixes,
|
| +@@ -131,8 +147,8 @@
|
| + #define GOOGLE_ULONGLONG(x) x##UI64
|
| + #define GOOGLE_LL_FORMAT "I64" // As in printf("%I64d", ...)
|
| + #else
|
| +-#define GOOGLE_LONGLONG(x) x##LL
|
| +-#define GOOGLE_ULONGLONG(x) x##ULL
|
| ++#define GOOGLE_LONGLONG(x) INT64_C(x)
|
| ++#define GOOGLE_ULONGLONG(x) UINT64_C(x)
|
| + #define GOOGLE_LL_FORMAT "ll" // As in "%lld". Note that "q" is poor form also.
|
| + #endif
|
| +
|
|
|