diff options
author | Amin Hassani <ahassani@google.com> | 2019-01-10 12:06:03 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-01-10 12:06:03 -0800 |
commit | 7c4adf06703ebdc0ebe580a02a27d460c2efdd00 (patch) | |
tree | 40285823a35f14791bfe177f751433b7d6f1961e | |
parent | a991b11084c65b7b5c7dbd02247b30e3200b9dd0 (diff) | |
parent | 0884bf668d8e1673c07f15dbe8052dfd2e7b789b (diff) | |
download | puffin-7c4adf06703ebdc0ebe580a02a27d460c2efdd00.tar.gz |
Do more spring house cleaning: Remove PUFFIN_EXPORT am: e8232e1100
am: 0884bf668d
Change-Id: I1ac29d7c35d85306858748d7d5dbe44cee1444c2
-rw-r--r-- | Android.bp | 7 | ||||
-rw-r--r-- | BUILD.gn | 10 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/include/puffin/common.h | 17 | ||||
-rw-r--r-- | src/include/puffin/huffer.h | 2 | ||||
-rw-r--r-- | src/include/puffin/puffdiff.h | 1 | ||||
-rw-r--r-- | src/include/puffin/puffer.h | 2 | ||||
-rw-r--r-- | src/include/puffin/puffpatch.h | 1 | ||||
-rw-r--r-- | src/include/puffin/utils.h | 5 |
9 files changed, 21 insertions, 26 deletions
@@ -2,7 +2,6 @@ cc_defaults { name: "puffin_defaults", host_supported: true, shared_libs: [ - "libbrillo", "libchrome", "libprotobuf-cpp-lite", ], @@ -73,6 +72,9 @@ cc_binary { "src/extent_stream.cc", "src/main.cc", ], + shared_libs: [ + "libbrillo", + ], static_libs: [ "libbsdiff", "libbspatch", @@ -99,6 +101,9 @@ cc_test { "src/unittest_common.cc", "src/utils_unittest.cc", ], + shared_libs: [ + "libbrillo", + ], static_libs: [ "libbsdiff", "libbspatch", @@ -23,7 +23,6 @@ group("all") { pkg_config("target_defaults") { pkg_deps = [ "libchrome-${libbase_ver}", - "libbrillo-${libbase_ver}", "protobuf-lite", ] cflags = [ "-Wextra" ] @@ -94,8 +93,15 @@ static_library("libpuffdiff") { ] } +pkg_config("libbrillo") { + pkg_deps = [ + "libbrillo-${libbase_ver}", + ] +} + executable("puffin") { configs += [ + ":libbrillo", ":target_defaults", ] deps = [ @@ -111,6 +117,7 @@ if (use.test) { executable("puffin_test") { configs += [ "//common-mk:test", + ":libbrillo", ":target_defaults", ] sources = [ @@ -134,6 +141,7 @@ if (use.fuzzer) { executable("puffin_fuzzer") { configs += [ "//common-mk/common_fuzzer", + ":libbrillo", ":target_defaults", ] deps = [ @@ -33,7 +33,7 @@ LIBPUFFIN = libpuffin.so UNITTESTS = puffin_unittests CXXFLAGS ?= -O3 -ggdb -CXXFLAGS += -Wall -fPIC -std=c++11 +CXXFLAGS += -Wall -fPIC -std=c++14 CPPFLAGS += -I../ -Isrc/include LDLIBS = -lgflags -lglog -lprotobuf-lite -lgtest -lpthread diff --git a/src/include/puffin/common.h b/src/include/puffin/common.h index 2ab1db8..954b7d9 100644 --- a/src/include/puffin/common.h +++ b/src/include/puffin/common.h @@ -9,25 +9,12 @@ #include <memory> #include <vector> -#ifdef USE_BRILLO -#include "base/macros.h" -#include "brillo/brillo_export.h" -#define PUFFIN_EXPORT BRILLO_EXPORT - -#else // USE_BRILLO - #ifndef DISALLOW_COPY_AND_ASSIGN #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ TypeName(const TypeName&) = delete; \ void operator=(const TypeName&) = delete #endif // DISALLOW_COPY_AND_ASSIGN -#ifndef PUFFIN_EXPORT -#define PUFFIN_EXPORT __attribute__((__visibility__("default"))) -#endif // PUFFIN_EXPORT - -#endif // USE_BRILLO - #ifndef FALLTHROUGH_INTENDED #ifdef __clang__ #define FALLTHROUGH_INTENDED [[clang::fallthrough]] @@ -43,7 +30,7 @@ using Buffer = std::vector<uint8_t>; // This class is similar to the protobuf generated for |ProtoByteExtent|. We // defined an extra class so the users of puffin do not have to include // puffin.pb.h and deal with its use. -struct PUFFIN_EXPORT ByteExtent { +struct ByteExtent { ByteExtent(uint64_t offset, uint64_t length) : offset(offset), length(length) {} @@ -55,7 +42,7 @@ struct PUFFIN_EXPORT ByteExtent { uint64_t length; }; -struct PUFFIN_EXPORT BitExtent { +struct BitExtent { BitExtent(uint64_t offset, uint64_t length) : offset(offset), length(length) {} diff --git a/src/include/puffin/huffer.h b/src/include/puffin/huffer.h index 4e6e42f..967b3e8 100644 --- a/src/include/puffin/huffer.h +++ b/src/include/puffin/huffer.h @@ -16,7 +16,7 @@ class BitWriterInterface; class PuffReaderInterface; class HuffmanTable; -class PUFFIN_EXPORT Huffer { +class Huffer { public: Huffer(); ~Huffer(); diff --git a/src/include/puffin/puffdiff.h b/src/include/puffin/puffdiff.h index 434dac7..c8883bf 100644 --- a/src/include/puffin/puffdiff.h +++ b/src/include/puffin/puffdiff.h @@ -47,7 +47,6 @@ bool PuffDiff(const Buffer& src, // The default puffdiff function that uses both bz2 and brotli to compress the // patch data. -PUFFIN_EXPORT bool PuffDiff(const Buffer& src, const Buffer& dst, const std::vector<BitExtent>& src_deflates, diff --git a/src/include/puffin/puffer.h b/src/include/puffin/puffer.h index f7b7c98..a472f87 100644 --- a/src/include/puffin/puffer.h +++ b/src/include/puffin/puffer.h @@ -17,7 +17,7 @@ class BitReaderInterface; class PuffWriterInterface; class HuffmanTable; -class PUFFIN_EXPORT Puffer { +class Puffer { public: // In older versions of puffin, there is a bug in the client which incorrectly // identifies the number of bits to cache when number of bits for the current diff --git a/src/include/puffin/puffpatch.h b/src/include/puffin/puffpatch.h index 46540cb..4eaa14b 100644 --- a/src/include/puffin/puffpatch.h +++ b/src/include/puffin/puffpatch.h @@ -25,7 +25,6 @@ extern const size_t kMagicLength; // |patch| IN The input patch. // |patch_length| IN The length of the patch. // |max_cache_size|IN The maximum amount of memory to cache puff buffers. -PUFFIN_EXPORT bool PuffPatch(UniqueStreamPtr src, UniqueStreamPtr dst, const uint8_t* patch, diff --git a/src/include/puffin/utils.h b/src/include/puffin/utils.h index 737454d..e8a8f8e 100644 --- a/src/include/puffin/utils.h +++ b/src/include/puffin/utils.h @@ -16,7 +16,7 @@ namespace puffin { // Converts an array of |ByteExtens| or |BitExtents| to a string. Each extent // has format "offset:length" and are comma separated. template <typename T> -PUFFIN_EXPORT std::string ExtentsToString(const T& extents) { +std::string ExtentsToString(const T& extents) { std::string str; for (const auto& extent : extents) { str += std::to_string(extent.offset) + ":" + std::to_string(extent.length) + @@ -45,7 +45,6 @@ bool LocateDeflatesInZlib(const Buffer& data, std::vector<BitExtent>* deflates); // Uses the function above, to locate deflates (bit addressed) in a given file // |file_path| using the list of zlib blocks |zlibs|. -PUFFIN_EXPORT bool LocateDeflatesInZlibBlocks(const std::string& file_path, const std::vector<ByteExtent>& zlibs, std::vector<BitExtent>* deflates); @@ -55,7 +54,6 @@ bool LocateDeflatesInZlibBlocks(const std::string& file_path, bool LocateDeflatesInGzip(const Buffer& data, std::vector<BitExtent>* deflates); // Search for the deflates in a zip archive, and put the result in |deflates|. -PUFFIN_EXPORT bool LocateDeflatesInZipArchive(const Buffer& data, std::vector<BitExtent>* deflates); @@ -78,7 +76,6 @@ bool FindPuffLocations(const UniqueStreamPtr& src, // Removes any BitExtents from both |extents1| and |extents2| if the data it // points to is found in both |extents1| and |extents2|. The order of the // remaining BitExtents is preserved. -PUFFIN_EXPORT void RemoveEqualBitExtents(const Buffer& data1, const Buffer& data2, std::vector<BitExtent>* extents1, |