Merge pull request #1005 from oon3m0oo/emscripten

Adds support for building protobuf with emscripten
This commit is contained in:
Feng Xiao 2015-11-24 15:22:06 -08:00
commit d8b6452e37
2 changed files with 5 additions and 1 deletions

View File

@ -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<class NodeType, class... Args>
void construct(NodeType* p, Args&&... args) {
new (static_cast<void*>(p)) NodeType(std::forward<Args>(args)...);

View File

@ -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)