Merge pull request #6127 from haon4/201905131051
Down integrate to GitHub
diff --git a/BUILD b/BUILD
index 8078b7e..f8ad0c5 100644
--- a/BUILD
+++ b/BUILD
@@ -999,3 +999,105 @@
default_runtime = "",
protoc = ":protoc",
)
+
+################################################################################
+# Conformance tests
+################################################################################
+
+proto_library(
+ name = "test_messages_proto2_proto",
+ srcs = ["src/google/protobuf/test_messages_proto2.proto"],
+ visibility = ["//visibility:public"],
+)
+
+proto_library(
+ name = "test_messages_proto3_proto",
+ srcs = ["src/google/protobuf/test_messages_proto3.proto"],
+ deps = [
+ ":any_proto",
+ ":duration_proto",
+ ":field_mask_proto",
+ ":struct_proto",
+ ":timestamp_proto",
+ ":wrappers_proto",
+ ],
+ visibility = ["//visibility:public"],
+)
+
+cc_proto_library(
+ name = "test_messages_proto2_proto_cc",
+ srcs = ["src/google/protobuf/test_messages_proto2.proto"],
+)
+
+cc_proto_library(
+ name = "test_messages_proto3_proto_cc",
+ srcs = ["src/google/protobuf/test_messages_proto3.proto"],
+ deps = [
+ ":cc_wkt_protos",
+ ],
+)
+
+proto_library(
+ name = "conformance_proto",
+ srcs = ["conformance/conformance.proto"],
+ visibility = ["//visibility:public"],
+)
+
+cc_proto_library(
+ name = "conformance_proto_cc",
+ srcs = ["conformance/conformance.proto"],
+)
+
+cc_library(
+ name = "jsoncpp",
+ hdrs = ["conformance/third_party/jsoncpp/json.h"],
+ srcs = ["conformance/third_party/jsoncpp/jsoncpp.cpp"],
+ includes = ["conformance"],
+)
+
+cc_library(
+ name = "conformance_test",
+ srcs = [
+ "conformance/conformance_test.cc",
+ "conformance/conformance_test_runner.cc",
+ ],
+ hdrs = [
+ "conformance/conformance_test.h",
+ ],
+ deps = [":conformance_proto_cc"],
+ includes = ["conformance", "src"],
+)
+
+cc_library(
+ name = "binary_json_conformance_suite",
+ srcs = ["conformance/binary_json_conformance_suite.cc"],
+ hdrs = ["conformance/binary_json_conformance_suite.h"],
+ deps = [
+ ":conformance_test",
+ ":jsoncpp",
+ ":test_messages_proto2_proto_cc",
+ ":test_messages_proto3_proto_cc",
+ ],
+)
+
+cc_library(
+ name = "text_format_conformance_suite",
+ srcs = ["conformance/text_format_conformance_suite.cc"],
+ hdrs = ["conformance/text_format_conformance_suite.h"],
+ deps = [
+ ":conformance_test",
+ ":test_messages_proto2_proto_cc",
+ ":test_messages_proto3_proto_cc",
+ ],
+)
+
+cc_library(
+ name = "conformance_test_runner",
+ srcs = ["conformance/conformance_test_main.cc"],
+ deps = [
+ ":binary_json_conformance_suite",
+ ":conformance_test",
+ ":text_format_conformance_suite",
+ ],
+ visibility = ["//visibility:public"],
+)
diff --git a/java/core/src/main/java/com/google/protobuf/RopeByteString.java b/java/core/src/main/java/com/google/protobuf/RopeByteString.java
index f294df3..e031839 100644
--- a/java/core/src/main/java/com/google/protobuf/RopeByteString.java
+++ b/java/core/src/main/java/com/google/protobuf/RopeByteString.java
@@ -60,7 +60,7 @@
* <p>Fundamentally the Rope algorithm represents the collection of pieces as a binary tree. BAP95
* uses a Fibonacci bound relating depth to a minimum sequence length, sequences that are too short
* relative to their depth cause a tree rebalance. More precisely, a tree of depth d is "balanced"
- * in the terminology of BAP95 if its length is at least F(d+2), where F(n) is the n-the Fibonacci
+ * in the terminology of BAP95 if its length is at least F(d+2), where F(n) is the n-th Fibonacci
* number. Thus for depths 0, 1, 2, 3, 4, 5,... we have minimum lengths 1, 2, 3, 5, 8, 13,...
*
* @author carlanton@google.com (Carl Haverl)
diff --git a/protobuf.pc.in b/protobuf.pc.in
index 282fef3..4e88b51 100644
--- a/protobuf.pc.in
+++ b/protobuf.pc.in
@@ -8,5 +8,5 @@
Version: @VERSION@
Libs: -L${libdir} -lprotobuf @PTHREAD_LIBS@
Libs.private: @LIBS@
-Cflags: -I${includedir} @PTHREAD_CFLAGS@ @CXXFLAGS@
+Cflags: -I${includedir} @PTHREAD_CFLAGS@
Conflicts: protobuf-lite
diff --git a/src/google/protobuf/generated_message_table_driven_lite.h b/src/google/protobuf/generated_message_table_driven_lite.h
index b36e51b..8cf177b 100644
--- a/src/google/protobuf/generated_message_table_driven_lite.h
+++ b/src/google/protobuf/generated_message_table_driven_lite.h
@@ -237,7 +237,7 @@
switch (ctype) {
case StringType_INLINED: {
- InlinedStringField* s;
+ InlinedStringField* s = nullptr;
switch (cardinality) {
case Cardinality_SINGULAR:
// TODO(ckennelly): Is this optimal?
diff --git a/src/google/protobuf/io/io_win32.cc b/src/google/protobuf/io/io_win32.cc
index b8f9bf8..eae2b7f 100755
--- a/src/google/protobuf/io/io_win32.cc
+++ b/src/google/protobuf/io/io_win32.cc
@@ -42,7 +42,7 @@
//
// This file is only used on Windows, it's empty on other platforms.
-#if defined(_WIN32)
+#if defined(_WIN32) && !defined(_XBOX_ONE)
// Comment this out to fall back to using the ANSI versions (open, mkdir, ...)
// instead of the Unicode ones (_wopen, _wmkdir, ...). Doing so can be useful to
diff --git a/src/google/protobuf/util/time_util.h b/src/google/protobuf/util/time_util.h
index 756e23b..8906beb 100644
--- a/src/google/protobuf/util/time_util.h
+++ b/src/google/protobuf/util/time_util.h
@@ -37,7 +37,14 @@
#include <ostream>
#include <string>
#ifdef _MSC_VER
+#ifdef _XBOX_ONE
+struct timeval {
+ long tv_sec; /* seconds */
+ long tv_usec; /* and microseconds */
+};
+#else
#include <winsock2.h>
+#endif // _XBOX_ONE
#else
#include <sys/time.h>
#endif