diff options
author | costan <costan@google.com> | 2017-07-26 10:08:17 -0700 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2017-07-27 16:46:42 -0700 |
commit | 038a3329b1965d67bf0dddb3fb6b984549fa48d3 (patch) | |
tree | 39cac0a887a2a6d3d5e5b050fb74f38015dfef75 | |
parent | a8b239c3de22b05c9f267940f3ee8df1a388f39b (diff) | |
download | snappy-git-038a3329b1965d67bf0dddb3fb6b984549fa48d3.tar.gz |
Inline DISALLOW_COPY_AND_ASSIGN.
snappy-stubs-public.h defined the DISALLOW_COPY_AND_ASSIGN macro, so the
definition propagated to all translation units that included the open
source headers. The macro is now inlined, thus avoiding polluting the
macro environment of snappy users.
-rw-r--r-- | snappy-internal.h | 4 | ||||
-rw-r--r-- | snappy-stubs-internal.h | 4 | ||||
-rw-r--r-- | snappy-stubs-public.h.in | 6 |
3 files changed, 6 insertions, 8 deletions
diff --git a/snappy-internal.h b/snappy-internal.h index 0cccba1..26be0cc 100644 --- a/snappy-internal.h +++ b/snappy-internal.h @@ -50,7 +50,9 @@ class WorkingMemory { uint16 small_table_[1<<10]; // 2KB uint16* large_table_; // Allocated only when needed - DISALLOW_COPY_AND_ASSIGN(WorkingMemory); + // No copying + WorkingMemory(const WorkingMemory&); + void operator=(const WorkingMemory&); }; // Flat array compression that does not emit the "uncompressed length" diff --git a/snappy-stubs-internal.h b/snappy-stubs-internal.h index 6979e1a..0dcd270 100644 --- a/snappy-stubs-internal.h +++ b/snappy-stubs-internal.h @@ -350,7 +350,9 @@ class Bits { static int FindLSBSetNonZero64(uint64 n); private: - DISALLOW_COPY_AND_ASSIGN(Bits); + // No copying + Bits(const Bits&); + void operator=(const Bits&); }; #ifdef HAVE_BUILTIN_CTZ diff --git a/snappy-stubs-public.h.in b/snappy-stubs-public.h.in index 96989ac..15f5c9e 100644 --- a/snappy-stubs-public.h.in +++ b/snappy-stubs-public.h.in @@ -80,12 +80,6 @@ typedef unsigned long long uint64; typedef std::string string; -#ifndef DISALLOW_COPY_AND_ASSIGN -#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&); \ - void operator=(const TypeName&) -#endif - #if !@ac_cv_have_sys_uio_h@ // Windows does not have an iovec type, yet the concept is universally useful. // It is simple to define it ourselves, so we put it inside our own namespace. |