From 8e869f76275253726da5a712de4d4a1b4de22ca2 Mon Sep 17 00:00:00 2001 From: Craig Donner Date: Tue, 24 Nov 2015 15:07:09 -0800 Subject: [PATCH] Adds support for buliding protobuf with emscripten; we just needed the proper platform define used in the right place. --- src/google/protobuf/map.h | 4 +++- src/google/protobuf/stubs/platform_macros.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index 52fba603a..4bd76f258 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -546,7 +546,9 @@ class Map { } #if __cplusplus >= 201103L && !defined(GOOGLE_PROTOBUF_OS_APPLE) && \ - !defined(GOOGLE_PROTOBUF_OS_NACL) && !defined(GOOGLE_PROTOBUF_OS_ANDROID) + !defined(GOOGLE_PROTOBUF_OS_NACL) && \ + !defined(GOOGLE_PROTOBUF_OS_ANDROID) && \ + !defined(GOOGLE_PROTOBUF_OS_EMSCRIPTEN) template void construct(NodeType* p, Args&&... args) { new (static_cast(p)) NodeType(std::forward(args)...); diff --git a/src/google/protobuf/stubs/platform_macros.h b/src/google/protobuf/stubs/platform_macros.h index 338d22f06..5cde8f4ef 100644 --- a/src/google/protobuf/stubs/platform_macros.h +++ b/src/google/protobuf/stubs/platform_macros.h @@ -97,6 +97,8 @@ GOOGLE_PROTOBUF_PLATFORM_ERROR #if TARGET_OS_IPHONE #define GOOGLE_PROTOBUF_OS_IPHONE #endif +#elif defined(__EMSCRIPTEN__) +#define GOOGLE_PROTOBUF_OS_EMSCRIPTEN #elif defined(__native_client__) #define GOOGLE_PROTOBUF_OS_NACL #elif defined(sun)