Merge pull request #653 from airtimemedia/master

Various compilation fixes
pull/645/head^2
Feng Xiao 9 years ago
commit dc80689af3
  1. 1
      cmake/libprotobuf-lite.cmake
  2. 1
      cmake/libprotobuf.cmake
  3. 4
      src/google/protobuf/compiler/java/java_map_field.cc
  4. 3
      src/google/protobuf/compiler/java/java_map_field.h
  5. 4
      src/google/protobuf/compiler/java/java_map_field_lite.cc
  6. 3
      src/google/protobuf/compiler/java/java_map_field_lite.h
  7. 2
      src/google/protobuf/map.h
  8. 4
      src/google/protobuf/stubs/mutex.h

@ -24,6 +24,7 @@ set(libprotobuf_lite_files
add_library(libprotobuf-lite ${libprotobuf_lite_files}) add_library(libprotobuf-lite ${libprotobuf_lite_files})
target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT}) target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT})
target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src)
set_target_properties(libprotobuf-lite PROPERTIES set_target_properties(libprotobuf-lite PROPERTIES
COMPILE_DEFINITIONS LIBPROTOBUF_EXPORTS COMPILE_DEFINITIONS LIBPROTOBUF_EXPORTS
OUTPUT_NAME ${LIB_PREFIX}protobuf-lite) OUTPUT_NAME ${LIB_PREFIX}protobuf-lite)

@ -54,6 +54,7 @@ set(libprotobuf_files
add_library(libprotobuf ${libprotobuf_lite_files} ${libprotobuf_files}) add_library(libprotobuf ${libprotobuf_lite_files} ${libprotobuf_files})
target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES}) target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES})
target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src)
set_target_properties(libprotobuf PROPERTIES set_target_properties(libprotobuf PROPERTIES
COMPILE_DEFINITIONS LIBPROTOBUF_EXPORTS COMPILE_DEFINITIONS LIBPROTOBUF_EXPORTS
OUTPUT_NAME ${LIB_PREFIX}protobuf) OUTPUT_NAME ${LIB_PREFIX}protobuf)

@ -156,9 +156,7 @@ ImmutableMapFieldGenerator(const FieldDescriptor* descriptor,
int messageBitIndex, int messageBitIndex,
int builderBitIndex, int builderBitIndex,
Context* context) Context* context)
: descriptor_(descriptor), messageBitIndex_(messageBitIndex), : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) {
builderBitIndex_(builderBitIndex), context_(context),
name_resolver_(context->GetNameResolver()) {
SetMessageVariables(descriptor, messageBitIndex, builderBitIndex, SetMessageVariables(descriptor, messageBitIndex, builderBitIndex,
context->GetFieldGeneratorInfo(descriptor), context->GetFieldGeneratorInfo(descriptor),
name_resolver_, &variables_); name_resolver_, &variables_);

@ -68,9 +68,6 @@ class ImmutableMapFieldGenerator : public ImmutableFieldGenerator {
private: private:
const FieldDescriptor* descriptor_; const FieldDescriptor* descriptor_;
map<string, string> variables_; map<string, string> variables_;
const int messageBitIndex_;
const int builderBitIndex_;
Context* context_;
ClassNameResolver* name_resolver_; ClassNameResolver* name_resolver_;
}; };

@ -139,9 +139,7 @@ ImmutableMapFieldLiteGenerator(const FieldDescriptor* descriptor,
int messageBitIndex, int messageBitIndex,
int builderBitIndex, int builderBitIndex,
Context* context) Context* context)
: descriptor_(descriptor), messageBitIndex_(messageBitIndex), : descriptor_(descriptor), name_resolver_(context->GetNameResolver()) {
builderBitIndex_(builderBitIndex), context_(context),
name_resolver_(context->GetNameResolver()) {
SetMessageVariables(descriptor, messageBitIndex, builderBitIndex, SetMessageVariables(descriptor, messageBitIndex, builderBitIndex,
context->GetFieldGeneratorInfo(descriptor), context->GetFieldGeneratorInfo(descriptor),
name_resolver_, &variables_); name_resolver_, &variables_);

@ -67,9 +67,6 @@ class ImmutableMapFieldLiteGenerator : public ImmutableFieldLiteGenerator {
private: private:
const FieldDescriptor* descriptor_; const FieldDescriptor* descriptor_;
map<string, string> variables_; map<string, string> variables_;
const int messageBitIndex_;
const int builderBitIndex_;
Context* context_;
ClassNameResolver* name_resolver_; ClassNameResolver* name_resolver_;
}; };

@ -172,7 +172,7 @@ class Map {
!defined(GOOGLE_PROTOBUF_OS_NACL) && !defined(GOOGLE_PROTOBUF_OS_ANDROID) !defined(GOOGLE_PROTOBUF_OS_NACL) && !defined(GOOGLE_PROTOBUF_OS_ANDROID)
template<class NodeType, class... Args> template<class NodeType, class... Args>
void construct(NodeType* p, Args&&... args) { void construct(NodeType* p, Args&&... args) {
new (p) NodeType(std::forward<Args>(args)...); new ((void*)p) NodeType(std::forward<Args>(args)...);
} }
template<class NodeType> template<class NodeType>

@ -30,6 +30,10 @@
#ifndef GOOGLE_PROTOBUF_STUBS_MUTEX_H_ #ifndef GOOGLE_PROTOBUF_STUBS_MUTEX_H_
#define GOOGLE_PROTOBUF_STUBS_MUTEX_H_ #define GOOGLE_PROTOBUF_STUBS_MUTEX_H_
#ifdef GOOGLE_PROTOBUF_NO_THREADLOCAL
#include <pthread.h>
#endif
#include <google/protobuf/stubs/macros.h> #include <google/protobuf/stubs/macros.h>
// =================================================================== // ===================================================================

Loading…
Cancel
Save