From e86541ac1d2345bac24ab38071ce24b13abb00c5 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 28 Oct 2020 17:53:09 -0700 Subject: [PATCH] Fixed the build after the merge. --- BUILD | 20 +++++++++++++++----- cmake/CMakeLists.txt | 6 +++--- examples/bazel/BUILD | 2 +- tests/bindings/lua/BUILD | 2 +- upb/decode_fast.c | 4 ++-- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/BUILD b/BUILD index efb4e36950..a18cff49d4 100644 --- a/BUILD +++ b/BUILD @@ -78,19 +78,26 @@ cc_library( ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], - deps = [":port", ":fastdecode"], + deps = [ + ":fastdecode", + ":port", + ], ) cc_library( name = "fastdecode", srcs = [ + "upb/decode.int.h", "upb/decode_fast.c", "upb/decode_fast.h", - "upb/decode.int.h", "upb/msg.h", "upb/upb.int.h", ], - deps = [":port", ":table"], + copts = UPB_DEFAULT_COPTS, + deps = [ + ":port", + ":table", + ], ) # Common support routines used by generated code. This library has no @@ -189,8 +196,8 @@ cc_library( cc_library( name = "table", hdrs = [ - "upb/table.int.h", - "upb/upb.h", + "upb/table.int.h", + "upb/upb.h", ], visibility = ["//tests:__pkg__"], deps = [ @@ -307,6 +314,7 @@ cc_library( name = "amalgamation", srcs = ["upb.c"], hdrs = ["upb.h"], + copts = UPB_DEFAULT_COPTS, ) upb_amalgamation( @@ -332,6 +340,7 @@ cc_library( name = "php_amalgamation", srcs = ["php-upb.c"], hdrs = ["php-upb.h"], + copts = UPB_DEFAULT_COPTS, ) upb_amalgamation( @@ -356,6 +365,7 @@ cc_library( name = "ruby_amalgamation", srcs = ["ruby-upb.c"], hdrs = ["ruby-upb.h"], + copts = UPB_DEFAULT_COPTS, ) exports_files( diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 48ee75d2dd..fcdce9936a 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -78,12 +78,12 @@ add_library(upb ../upb/upb.h ../upb/upb.hpp) target_link_libraries(upb - port - fastdecode) + fastdecode + port) add_library(fastdecode + ../upb/decode.int.h ../upb/decode_fast.c ../upb/decode_fast.h - ../upb/decode.int.h ../upb/msg.h ../upb/upb.int.h) target_link_libraries(fastdecode diff --git a/examples/bazel/BUILD b/examples/bazel/BUILD index af2c6f8cde..97119252e2 100644 --- a/examples/bazel/BUILD +++ b/examples/bazel/BUILD @@ -16,6 +16,6 @@ upb_proto_library( cc_binary( name = "test_binary", srcs = ["test_binary.c"], - deps = [":foo_upbproto"], copts = ["-std=c99"], + deps = [":foo_upbproto"], ) diff --git a/tests/bindings/lua/BUILD b/tests/bindings/lua/BUILD index 00eb3ba274..8834feb8ff 100644 --- a/tests/bindings/lua/BUILD +++ b/tests/bindings/lua/BUILD @@ -12,6 +12,7 @@ licenses(["notice"]) cc_test( name = "test_lua", srcs = ["main.c"], + copts = UPB_DEFAULT_COPTS, data = [ "test_upb.lua", ":descriptor_proto_lua", @@ -24,7 +25,6 @@ cc_test( "@com_google_protobuf//:conformance_proto", "@com_google_protobuf//:descriptor_proto", ], - copts = UPB_DEFAULT_COPTS, linkstatic = 1, deps = [ "//upb/bindings/lua:lupb", diff --git a/upb/decode_fast.c b/upb/decode_fast.c index d136feda9f..e38f8be1f1 100644 --- a/upb/decode_fast.c +++ b/upb/decode_fast.c @@ -356,7 +356,7 @@ static const char *fastdecode_varint64(const char *ptr, uint64_t *val) { *val += (byte - 1) << 63; } done: - __builtin_assume(ptr != NULL); + UPB_ASSUME(ptr != NULL); return ptr; } @@ -897,7 +897,7 @@ static const char *fastdecode_tosubmsg(upb_decstate *d, const char *ptr, void *ctx) { fastdecode_submsgdata *submsg = ctx; ptr = fastdecode_dispatch(d, ptr, submsg->msg, submsg->layout, 0); - __builtin_assume(ptr != NULL); + UPB_ASSUME(ptr != NULL); return ptr; }