Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
6654e77f
Commit
6654e77f
authored
Aug 14, 2015
by
Dan O'Reilly
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into py2_py3_straddle
parents
981d6bf2
53435df5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
338 additions
and
18 deletions
+338
-18
CMakeLists.txt
cmake/CMakeLists.txt
+32
-0
install.cmake
cmake/install.cmake
+103
-0
protobuf-config-version.cmake.in
cmake/protobuf-config-version.cmake.in
+1
-0
protobuf-config.cmake.in
cmake/protobuf-config.cmake.in
+27
-0
protobuf-module.cmake.in
cmake/protobuf-module.cmake.in
+139
-0
failure_list_ruby.txt
conformance/failure_list_ruby.txt
+0
-15
FileDescriptor.cs
csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
+16
-0
upb.c
ruby/ext/google/protobuf_c/upb.c
+0
-0
upb.h
ruby/ext/google/protobuf_c/upb.h
+9
-2
csharp_helpers.h
src/google/protobuf/compiler/csharp/csharp_helpers.h
+4
-1
csharp_umbrella_class.cc
src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc
+7
-0
No files found.
cmake/CMakeLists.txt
View file @
6654e77f
# Minimum CMake required
cmake_minimum_required
(
VERSION 2.8
)
cmake_minimum_required
(
VERSION 2.8
)
# Project
project
(
protobuf C CXX
)
project
(
protobuf C CXX
)
# Options
option
(
BUILD_TESTING
"Build tests"
ON
)
option
(
BUILD_TESTING
"Build tests"
ON
)
option
(
BUILD_SHARED_LIBS
"Build Shared Libraries"
OFF
)
option
(
BUILD_SHARED_LIBS
"Build Shared Libraries"
OFF
)
if
(
MSVC
)
if
(
MSVC
)
option
(
ZLIB
"Build with zlib support"
OFF
)
option
(
ZLIB
"Build with zlib support"
OFF
)
endif
(
MSVC
)
endif
(
MSVC
)
# Path to main configure script
set
(
protobuf_CONFIGURE_SCRIPT
"../configure.ac"
)
# Parse version from configure script
file
(
STRINGS
"
${
protobuf_CONFIGURE_SCRIPT
}
"
protobuf_VERSION_LINE
LIMIT_COUNT 1
REGEX
"^AC_INIT"
)
# Replace special characters
string
(
REPLACE
"("
"_"
protobuf_VERSION_LINE
${
protobuf_VERSION_LINE
}
)
string
(
REPLACE
")"
"_"
protobuf_VERSION_LINE
${
protobuf_VERSION_LINE
}
)
string
(
REPLACE
"["
"_"
protobuf_VERSION_LINE
${
protobuf_VERSION_LINE
}
)
string
(
REPLACE
"]"
"_"
protobuf_VERSION_LINE
${
protobuf_VERSION_LINE
}
)
# Parse version string
string
(
REGEX REPLACE
"^AC_INIT__Protocol Buffers_,_([^_]+).*$"
"
\\
1"
protobuf_VERSION_STRING
"
${
protobuf_VERSION_LINE
}
"
)
# Parse version tweaks
string
(
REGEX REPLACE
"^([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+).*$"
"
\\
1"
protobuf_VERSION_MAJOR
"
${
protobuf_VERSION_STRING
}
"
)
string
(
REGEX REPLACE
"^([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+).*$"
"
\\
2"
protobuf_VERSION_MINOR
"
${
protobuf_VERSION_STRING
}
"
)
string
(
REGEX REPLACE
"^([0-9]+)
\\
.([0-9]+)
\\
.([0-9]+).*$"
"
\\
3"
protobuf_VERSION_PATCH
"
${
protobuf_VERSION_STRING
}
"
)
# Package version
set
(
protobuf_VERSION
"
${
protobuf_VERSION_MAJOR
}
.
${
protobuf_VERSION_MINOR
}
.
${
protobuf_VERSION_PATCH
}
"
)
add_definitions
(
-DGOOGLE_PROTOBUF_CMAKE_BUILD
)
add_definitions
(
-DGOOGLE_PROTOBUF_CMAKE_BUILD
)
find_package
(
Threads REQUIRED
)
find_package
(
Threads REQUIRED
)
...
@@ -86,6 +115,9 @@ include(libprotobuf-lite.cmake)
...
@@ -86,6 +115,9 @@ include(libprotobuf-lite.cmake)
include
(
libprotobuf.cmake
)
include
(
libprotobuf.cmake
)
include
(
libprotoc.cmake
)
include
(
libprotoc.cmake
)
include
(
protoc.cmake
)
include
(
protoc.cmake
)
if
(
BUILD_TESTING
)
if
(
BUILD_TESTING
)
include
(
tests.cmake
)
include
(
tests.cmake
)
endif
(
BUILD_TESTING
)
endif
(
BUILD_TESTING
)
include
(
install.cmake
)
cmake/install.cmake
0 → 100644
View file @
6654e77f
include
(
GNUInstallDirs
)
foreach
(
_library
libprotobuf-lite
libprotobuf
libprotoc
)
set_property
(
TARGET
${
_library
}
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<INSTALL_INTERFACE:
${
CMAKE_INSTALL_INCLUDEDIR
}
>
)
install
(
TARGETS
${
_library
}
EXPORT protobuf-targets
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
COMPONENT
${
_library
}
LIBRARY DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
COMPONENT
${
_library
}
ARCHIVE DESTINATION
${
CMAKE_INSTALL_LIBDIR
}
COMPONENT
${
_library
}
)
endforeach
()
install
(
TARGETS protoc EXPORT protobuf-targets
RUNTIME DESTINATION
${
CMAKE_INSTALL_BINDIR
}
COMPONENT protoc
)
if
(
TRUE
)
file
(
STRINGS extract_includes.bat.in _extract_strings
REGEX
"^copy"
)
foreach
(
_extract_string
${
_extract_strings
}
)
string
(
REPLACE
"copy
\$
{PROTOBUF_SOURCE_WIN32_PATH}
\\
"
""
_extract_string
${
_extract_string
}
)
string
(
REPLACE
"
\\
"
"/"
_extract_string
${
_extract_string
}
)
string
(
REGEX MATCH
"^[^ ]+"
_extract_from
${
_extract_string
}
)
string
(
REGEX REPLACE
"^
${
_extract_from
}
([^$]+)"
"
\\
1"
_extract_to
${
_extract_string
}
)
get_filename_component
(
_extract_from
"
${
protobuf_SOURCE_DIR
}
/
${
_extract_from
}
"
ABSOLUTE
)
get_filename_component
(
_extract_name
${
_extract_to
}
NAME
)
get_filename_component
(
_extract_to
${
_extract_to
}
PATH
)
string
(
REPLACE
"include/"
"
${
CMAKE_INSTALL_INCLUDEDIR
}
/"
_extract_to
"
${
_extract_to
}
"
)
if
(
EXISTS
"
${
_extract_from
}
"
)
install
(
FILES
"
${
_extract_from
}
"
DESTINATION
"
${
_extract_to
}
"
COMPONENT protobuf-headers
RENAME
"
${
_extract_name
}
"
)
else
()
message
(
AUTHOR_WARNING
"The file
\"
${
_extract_from
}
\"
is listed in "
"
\"
${
protobuf_SOURCE_DIR
}
/cmake/extract_includes.bat.in
\"
"
"but there not exists. The file will not be installed."
)
endif
()
endforeach
()
endif
()
# Internal function for parsing auto tools scripts
function
(
_protobuf_auto_list FILE_NAME VARIABLE
)
file
(
STRINGS
${
FILE_NAME
}
_strings
)
set
(
_list
)
foreach
(
_string
${
_strings
}
)
set
(
_found
)
string
(
REGEX MATCH
"^[
\t
]*
${
VARIABLE
}
[
\t
]*=[
\t
]*"
_found
"
${
_string
}
"
)
if
(
_found
)
string
(
LENGTH
"
${
_found
}
"
_length
)
string
(
SUBSTRING
"
${
_string
}
"
${
_length
}
-1 _draft_list
)
foreach
(
_item
${
_draft_list
}
)
string
(
STRIP
"
${
_item
}
"
_item
)
list
(
APPEND _list
"
${
_item
}
"
)
endforeach
()
endif
()
endforeach
()
set
(
${
VARIABLE
}
${
_list
}
PARENT_SCOPE
)
endfunction
()
# Install well-known type proto files
_protobuf_auto_list
(
"../src/Makefile.am"
nobase_dist_proto_DATA
)
foreach
(
_file
${
nobase_dist_proto_DATA
}
)
get_filename_component
(
_file_from
"../src/
${
_file
}
"
ABSOLUTE
)
get_filename_component
(
_file_name
${
_file
}
NAME
)
get_filename_component
(
_file_path
${
_file
}
PATH
)
if
(
EXISTS
"
${
_file_from
}
"
)
install
(
FILES
"
${
_file_from
}
"
DESTINATION
"
${
CMAKE_INSTALL_INCLUDEDIR
}
/
${
_file_path
}
"
COMPONENT protobuf-protos
RENAME
"
${
_file_name
}
"
)
else
()
message
(
AUTHOR_WARNING
"The file
\"
${
_file_from
}
\"
is listed in "
"
\"
${
protobuf_SOURCE_DIR
}
/../src/Makefile.am
\"
as nobase_dist_proto_DATA "
"but there not exists. The file will not be installed."
)
endif
()
endforeach
()
# Export configuration
install
(
EXPORT protobuf-targets
DESTINATION
"lib/cmake/protobuf"
COMPONENT protobuf-export
)
configure_file
(
protobuf-config.cmake.in
protobuf-config.cmake @ONLY
)
configure_file
(
protobuf-config-version.cmake.in
protobuf-config-version.cmake @ONLY
)
configure_file
(
protobuf-module.cmake.in
protobuf-module.cmake @ONLY
)
install
(
FILES
"
${
protobuf_BINARY_DIR
}
/protobuf-config.cmake"
"
${
protobuf_BINARY_DIR
}
/protobuf-config-version.cmake"
"
${
protobuf_BINARY_DIR
}
/protobuf-module.cmake"
DESTINATION
"lib/cmake/protobuf"
COMPONENT protobuf-export
)
cmake/protobuf-config-version.cmake.in
0 → 100644
View file @
6654e77f
set(PACKAGE_VERSION @protobuf_VERSION@)
cmake/protobuf-config.cmake.in
0 → 100644
View file @
6654e77f
# Version info variables
set(PROTOBUF_VERSION "@protobuf_VERSION@")
set(PROTOBUF_VERSION_STRING "@protobuf_VERSION_STRING@")
# Current dir
get_filename_component(_PROTOBUF_PACKAGE_PREFIX
"${CMAKE_CURRENT_LIST_FILE}" PATH)
# Imported targets
include("${_PROTOBUF_PACKAGE_PREFIX}/protobuf-targets.cmake")
# Compute the installation prefix relative to this file.
get_filename_component(_PROTOBUF_IMPORT_PREFIX
"${_PROTOBUF_PACKAGE_PREFIX}" PATH)
get_filename_component(_PROTOBUF_IMPORT_PREFIX
"${_PROTOBUF_IMPORT_PREFIX}" PATH)
get_filename_component(_PROTOBUF_IMPORT_PREFIX
"${_PROTOBUF_IMPORT_PREFIX}" PATH)
# CMake FindProtobuf module compatible file
if(NOT DEFINED PROTOBUF_MODULE_COMPATIBLE OR "${PROTOBUF_MODULE_COMPATIBLE}")
include("${_PROTOBUF_PACKAGE_PREFIX}/protobuf-module.cmake")
endif()
# Cleanup temporary variables.
set(_PROTOBUF_PACKAGE_PREFIX)
set(_PROTOBUF_IMPORT_PREFIX)
cmake/protobuf-module.cmake.in
0 → 100644
View file @
6654e77f
if(PROTOBUF_SRC_ROOT_FOLDER)
message(AUTHOR_WARNING "Variable PROTOBUF_SRC_ROOT_FOLDER defined, but not"
" used in CONFIG mode")
endif()
function(PROTOBUF_GENERATE_CPP SRCS HDRS)
if(NOT ARGN)
message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files")
return()
endif()
if(PROTOBUF_GENERATE_CPP_APPEND_PATH)
# Create an include path for each file specified
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(ABS_PATH ${ABS_FIL} PATH)
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
if(${_contains_already} EQUAL -1)
list(APPEND _protobuf_include_path -I ${ABS_PATH})
endif()
endforeach()
else()
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif()
# Add well-known type protos include path
list(APPEND _protobuf_include_path
-I "${_PROTOBUF_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@")
if(DEFINED PROTOBUF_IMPORT_DIRS)
foreach(DIR ${PROTOBUF_IMPORT_DIRS})
get_filename_component(ABS_PATH ${DIR} ABSOLUTE)
list(FIND _protobuf_include_path ${ABS_PATH} _contains_already)
if(${_contains_already} EQUAL -1)
list(APPEND _protobuf_include_path -I ${ABS_PATH})
endif()
endforeach()
endif()
set(${SRCS})
set(${HDRS})
foreach(FIL ${ARGN})
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
get_filename_component(FIL_WE ${FIL} NAME_WE)
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE}
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} ${_protobuf_include_path} ${ABS_FIL}
DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
VERBATIM)
endforeach()
set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
set(${SRCS} ${${SRCS}} PARENT_SCOPE)
set(${HDRS} ${${HDRS}} PARENT_SCOPE)
endfunction()
# Internal function: search for normal library as well as a debug one
# if the debug one is specified also include debug/optimized keywords
# in *_LIBRARIES variable
function(_protobuf_find_libraries name filename)
get_target_property(${name}_LIBRARY lib${filename}
IMPORTED_LOCATION_RELEASE)
set(${name}_LIBRARY "${${name}_LIBRARY}" PARENT_SCOPE)
get_target_property(${name}_LIBRARY_DEBUG lib${filename}
IMPORTED_LOCATION_DEBUG)
set(${name}_LIBRARY_DEBUG "${${name}_LIBRARY_DEBUG}" PARENT_SCOPE)
if(NOT ${name}_LIBRARY_DEBUG)
# There is no debug library
set(${name}_LIBRARY_DEBUG ${${name}_LIBRARY} PARENT_SCOPE)
set(${name}_LIBRARIES ${${name}_LIBRARY} PARENT_SCOPE)
else()
# There IS a debug library
set(${name}_LIBRARIES
optimized ${${name}_LIBRARY}
debug ${${name}_LIBRARY_DEBUG}
PARENT_SCOPE
)
endif()
endfunction()
# Internal function: find threads library
function(_protobuf_find_threads)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads)
if(Threads_FOUND)
list(APPEND PROTOBUF_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
set(PROTOBUF_LIBRARIES "${PROTOBUF_LIBRARIES}" PARENT_SCOPE)
endif()
endfunction()
#
# Main.
#
# By default have PROTOBUF_GENERATE_CPP macro pass -I to protoc
# for each directory where a proto file is referenced.
if(NOT DEFINED PROTOBUF_GENERATE_CPP_APPEND_PATH)
set(PROTOBUF_GENERATE_CPP_APPEND_PATH TRUE)
endif()
# The Protobuf library
_protobuf_find_libraries(PROTOBUF protobuf)
# The Protobuf Lite library
_protobuf_find_libraries(PROTOBUF_LITE protobuf-lite)
# The Protobuf Protoc Library
_protobuf_find_libraries(PROTOBUF_PROTOC protoc)
if(UNIX)
_protobuf_find_threads()
endif()
# Set the include directory
set(PROTOBUF_INCLUDE_DIR "${_PROTOBUF_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@")
# Set the protoc Executable
get_target_property(PROTOBUF_PROTOC_EXECUTABLE protoc
IMPORTED_LOCATION_RELEASE)
if(NOT PROTOBUF_PROTOC_EXECUTABLE)
get_target_property(PROTOBUF_PROTOC_EXECUTABLE protoc
IMPORTED_LOCATION_DEBUG)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PROTOBUF DEFAULT_MSG
PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)
if(PROTOBUF_FOUND)
set(PROTOBUF_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIR})
endif()
conformance/failure_list_ruby.txt
View file @
6654e77f
JsonInput.HelloWorld.JsonOutput
JsonInput.HelloWorld.JsonOutput
JsonInput.HelloWorld.ProtobufOutput
JsonInput.HelloWorld.ProtobufOutput
ProtobufInput.PrematureEofBeforeUnknownValue.DOUBLE
ProtobufInput.PrematureEofBeforeUnknownValue.FIXED32
ProtobufInput.PrematureEofBeforeUnknownValue.FIXED64
ProtobufInput.PrematureEofBeforeUnknownValue.FLOAT
ProtobufInput.PrematureEofBeforeUnknownValue.SFIXED32
ProtobufInput.PrematureEofBeforeUnknownValue.SFIXED64
ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.BYTES
ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.MESSAGE
ProtobufInput.PrematureEofInDelimitedDataForUnknownValue.STRING
ProtobufInput.PrematureEofInsideUnknownValue.DOUBLE
ProtobufInput.PrematureEofInsideUnknownValue.FIXED32
ProtobufInput.PrematureEofInsideUnknownValue.FIXED64
ProtobufInput.PrematureEofInsideUnknownValue.FLOAT
ProtobufInput.PrematureEofInsideUnknownValue.SFIXED32
ProtobufInput.PrematureEofInsideUnknownValue.SFIXED64
csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
View file @
6654e77f
...
@@ -368,5 +368,20 @@ namespace Google.Protobuf.Reflection
...
@@ -368,5 +368,20 @@ namespace Google.Protobuf.Reflection
{
{
return
"FileDescriptor for "
+
proto
.
Name
;
return
"FileDescriptor for "
+
proto
.
Name
;
}
}
/// <summary>
/// Returns the file descriptor for descriptor.proto.
/// </summary>
/// <remarks>
/// This is used for protos which take a direct dependency on <c>descriptor.proto</c>, typically for
/// annotations. While <c>descriptor.proto</c> is a proto2 file, it is built into the Google.Protobuf
/// runtime for reflection purposes. The messages are internal to the runtime as they would require
/// proto2 semantics for full support, but the file descriptor is available via this property. The
/// C# codegen in protoc automatically uses this property when it detects a dependency on <c>descriptor.proto</c>.
/// </remarks>
/// <value>
/// The file descriptor for <c>descriptor.proto</c>.
/// </value>
public
static
FileDescriptor
DescriptorProtoFileDescriptor
{
get
{
return
DescriptorProtoFile
.
Descriptor
;
}
}
}
}
}
}
\ No newline at end of file
ruby/ext/google/protobuf_c/upb.c
View file @
6654e77f
This diff is collapsed.
Click to expand it.
ruby/ext/google/protobuf_c/upb.h
View file @
6654e77f
...
@@ -5635,7 +5635,7 @@ UPB_INLINE bool upb_bufsrc_putbuf(const char *buf, size_t len,
...
@@ -5635,7 +5635,7 @@ UPB_INLINE bool upb_bufsrc_putbuf(const char *buf, size_t len,
upb_bufhandle_setbuf
(
&
handle
,
buf
,
0
);
upb_bufhandle_setbuf
(
&
handle
,
buf
,
0
);
ret
=
upb_bytessink_start
(
sink
,
len
,
&
subc
);
ret
=
upb_bytessink_start
(
sink
,
len
,
&
subc
);
if
(
ret
&&
len
!=
0
)
{
if
(
ret
&&
len
!=
0
)
{
ret
=
(
upb_bytessink_putbuf
(
sink
,
subc
,
buf
,
len
,
&
handle
)
=
=
len
);
ret
=
(
upb_bytessink_putbuf
(
sink
,
subc
,
buf
,
len
,
&
handle
)
>
=
len
);
}
}
if
(
ret
)
{
if
(
ret
)
{
ret
=
upb_bytessink_end
(
sink
);
ret
=
upb_bytessink_end
(
sink
);
...
@@ -7123,7 +7123,7 @@ class upb::pb::DecoderMethod {
...
@@ -7123,7 +7123,7 @@ class upb::pb::DecoderMethod {
* constructed. This hint may be an overestimate for some build configurations.
* constructed. This hint may be an overestimate for some build configurations.
* But if the decoder library is upgraded without recompiling the application,
* But if the decoder library is upgraded without recompiling the application,
* it may be an underestimate. */
* it may be an underestimate. */
#define UPB_PB_DECODER_SIZE 440
0
#define UPB_PB_DECODER_SIZE 440
8
#ifdef __cplusplus
#ifdef __cplusplus
...
@@ -7548,6 +7548,12 @@ struct upb_pbdecoder {
...
@@ -7548,6 +7548,12 @@ struct upb_pbdecoder {
char
residual
[
12
];
char
residual
[
12
];
char
*
residual_end
;
char
*
residual_end
;
/* Bytes of data that should be discarded from the input beore we start
* parsing again. We set this when we internally determine that we can
* safely skip the next N bytes, but this region extends past the current
* user buffer. */
size_t
skip
;
/* Stores the user buffer passed to our decode function. */
/* Stores the user buffer passed to our decode function. */
const
char
*
buf_param
;
const
char
*
buf_param
;
size_t
size_param
;
size_t
size_param
;
...
@@ -7590,6 +7596,7 @@ void upb_pbdecoder_seterr(upb_pbdecoder *d, const char *msg);
...
@@ -7590,6 +7596,7 @@ void upb_pbdecoder_seterr(upb_pbdecoder *d, const char *msg);
/* Error messages that are shared between the bytecode and JIT decoders. */
/* Error messages that are shared between the bytecode and JIT decoders. */
extern
const
char
*
kPbDecoderStackOverflow
;
extern
const
char
*
kPbDecoderStackOverflow
;
extern
const
char
*
kPbDecoderSubmessageTooLong
;
/* Access to decoderplan members needed by the decoder. */
/* Access to decoderplan members needed by the decoder. */
const
char
*
upb_pbdecoder_getopname
(
unsigned
int
op
);
const
char
*
upb_pbdecoder_getopname
(
unsigned
int
op
);
...
...
src/google/protobuf/compiler/csharp/csharp_helpers.h
View file @
6654e77f
...
@@ -117,7 +117,10 @@ inline bool IsMapEntryMessage(const Descriptor* descriptor) {
...
@@ -117,7 +117,10 @@ inline bool IsMapEntryMessage(const Descriptor* descriptor) {
inline
bool
IsDescriptorProto
(
const
FileDescriptor
*
descriptor
)
{
inline
bool
IsDescriptorProto
(
const
FileDescriptor
*
descriptor
)
{
// TODO: Do this better! (Currently this depends on a hack in generate_protos.sh to rename
// TODO: Do this better! (Currently this depends on a hack in generate_protos.sh to rename
// the file...)
// the file...)
return
descriptor
->
name
()
==
"google/protobuf/descriptor_proto_file.proto"
;
// We need to be able to detect the "normal" name as well, for times that we're just
// depending on descriptor.proto instead of generating it.
return
descriptor
->
name
()
==
"google/protobuf/descriptor_proto_file.proto"
||
descriptor
->
name
()
==
"google/protobuf/descriptor.proto"
;
}
}
inline
bool
IsWrapperType
(
const
FieldDescriptor
*
descriptor
)
{
inline
bool
IsWrapperType
(
const
FieldDescriptor
*
descriptor
)
{
...
...
src/google/protobuf/compiler/csharp/csharp_umbrella_class.cc
View file @
6654e77f
...
@@ -180,11 +180,18 @@ void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) {
...
@@ -180,11 +180,18 @@ void UmbrellaClassGenerator::WriteDescriptor(io::Printer* printer) {
"descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
\n
"
);
"descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
\n
"
);
printer
->
Print
(
" new pbr::FileDescriptor[] { "
);
printer
->
Print
(
" new pbr::FileDescriptor[] { "
);
for
(
int
i
=
0
;
i
<
file_
->
dependency_count
();
i
++
)
{
for
(
int
i
=
0
;
i
<
file_
->
dependency_count
();
i
++
)
{
// descriptor.proto is special: we don't allow access to the generated code, but there's
// a separately-exposed property to get at the file descriptor, specifically to allow this
// kind of dependency.
if
(
IsDescriptorProto
(
file_
->
dependency
(
i
)))
{
printer
->
Print
(
"pbr::FileDescriptor.DescriptorProtoFileDescriptor, "
);
}
else
{
printer
->
Print
(
printer
->
Print
(
"$full_umbrella_class_name$.Descriptor, "
,
"$full_umbrella_class_name$.Descriptor, "
,
"full_umbrella_class_name"
,
"full_umbrella_class_name"
,
GetUmbrellaClassName
(
file_
->
dependency
(
i
)));
GetUmbrellaClassName
(
file_
->
dependency
(
i
)));
}
}
}
printer
->
Print
(
"},
\n
"
printer
->
Print
(
"},
\n
"
" new pbr::GeneratedCodeInfo("
);
" new pbr::GeneratedCodeInfo("
);
// Specify all the generated code information, recursively.
// Specify all the generated code information, recursively.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment