1
0
Эх сурвалжийг харах

rename BASE_ prefixes to BUTIL_ to avoid potential conflicts

gejun 6 жил өмнө
parent
commit
5109a6fec2
100 өөрчлөгдсөн 481 нэмэгдсэн , 481 устгасан
  1. 1 1
      example/memcache_c++/client.cpp
  2. 1 1
      example/multi_threaded_echo_fns_c++/client.cpp
  3. 1 1
      src/brpc/details/usercode_backup_pool.cpp
  4. 1 1
      src/brpc/input_messenger.h
  5. 1 1
      src/brpc/load_balancer.cpp
  6. 3 3
      src/brpc/log.h
  7. 1 1
      src/brpc/protocol.cpp
  8. 1 1
      src/brpc/server.cpp
  9. 1 1
      src/brpc/server_id.h
  10. 6 6
      src/brpc/socket_inl.h
  11. 1 1
      src/brpc/socket_map.cpp
  12. 1 1
      src/bthread/bthread.cpp
  13. 1 1
      src/bthread/fd.cpp
  14. 2 2
      src/bthread/key.cpp
  15. 5 5
      src/bthread/mutex.cpp
  16. 1 1
      src/bthread/stack.cpp
  17. 4 4
      src/butil/at_exit.h
  18. 3 3
      src/butil/atomic_ref_count.h
  19. 3 3
      src/butil/atomic_sequence_num.h
  20. 8 8
      src/butil/atomicops.h
  21. 3 3
      src/butil/atomicops_internals_arm64_gcc.h
  22. 3 3
      src/butil/atomicops_internals_arm_gcc.h
  23. 3 3
      src/butil/atomicops_internals_atomicword_compat.h
  24. 3 3
      src/butil/atomicops_internals_gcc.h
  25. 3 3
      src/butil/atomicops_internals_mac.h
  26. 3 3
      src/butil/atomicops_internals_mips_gcc.h
  27. 3 3
      src/butil/atomicops_internals_tsan.h
  28. 2 2
      src/butil/atomicops_internals_x86_gcc.cc
  29. 5 5
      src/butil/atomicops_internals_x86_gcc.h
  30. 3 3
      src/butil/atomicops_internals_x86_msvc.h
  31. 3 3
      src/butil/auto_reset.h
  32. 5 5
      src/butil/base64.h
  33. 17 17
      src/butil/base_export.h
  34. 3 3
      src/butil/basictypes.h
  35. 5 5
      src/butil/big_endian.h
  36. 3 3
      src/butil/bit_array.h
  37. 3 3
      src/butil/bits.h
  38. 6 6
      src/butil/build_config.h
  39. 3 3
      src/butil/cancelable_callback.h
  40. 3 3
      src/butil/comlog_sink.h
  41. 8 8
      src/butil/compiler_specific.h
  42. 3 3
      src/butil/containers/bounded_queue.h
  43. 3 3
      src/butil/containers/case_ignored_flat_map.h
  44. 3 3
      src/butil/containers/doubly_buffered_data.h
  45. 4 4
      src/butil/containers/flat_map.h
  46. 3 3
      src/butil/containers/flat_map_inl.h
  47. 14 14
      src/butil/containers/hash_tables.h
  48. 3 3
      src/butil/containers/linked_list.h
  49. 3 3
      src/butil/containers/mru_cache.h
  50. 4 4
      src/butil/containers/pooled_map.h
  51. 3 3
      src/butil/containers/scoped_ptr_hash_map.h
  52. 3 3
      src/butil/containers/small_map.h
  53. 3 3
      src/butil/containers/stack_container.h
  54. 4 4
      src/butil/cpu.h
  55. 3 3
      src/butil/crc32c.h
  56. 4 4
      src/butil/debug/alias.h
  57. 8 8
      src/butil/debug/asan_invalid_access.h
  58. 14 14
      src/butil/debug/crash_logging.h
  59. 8 8
      src/butil/debug/debugger.h
  60. 5 5
      src/butil/debug/dump_without_crashing.h
  61. 3 3
      src/butil/debug/leak_annotations.h
  62. 3 3
      src/butil/debug/leak_tracker.h
  63. 5 5
      src/butil/debug/proc_maps_linux.h
  64. 7 7
      src/butil/debug/stack_trace.h
  65. 1 1
      src/butil/endpoint.h
  66. 7 7
      src/butil/environment.h
  67. 3 3
      src/butil/file_descriptor_posix.h
  68. 62 62
      src/butil/file_util.h
  69. 3 3
      src/butil/files/dir_reader_fallback.h
  70. 3 3
      src/butil/files/dir_reader_linux.h
  71. 3 3
      src/butil/files/dir_reader_posix.h
  72. 3 3
      src/butil/files/fd_guard.h
  73. 5 5
      src/butil/files/file.h
  74. 5 5
      src/butil/files/file_enumerator.h
  75. 7 7
      src/butil/files/file_path.h
  76. 4 4
      src/butil/files/file_path_watcher.h
  77. 3 3
      src/butil/files/file_path_watcher_fsevents.h
  78. 3 3
      src/butil/files/file_path_watcher_kqueue.h
  79. 3 3
      src/butil/files/file_watcher.h
  80. 4 4
      src/butil/files/memory_mapped_file.h
  81. 4 4
      src/butil/files/scoped_file.h
  82. 4 4
      src/butil/files/scoped_temp_dir.h
  83. 3 3
      src/butil/files/temp_file.h
  84. 3 3
      src/butil/float_util.h
  85. 3 3
      src/butil/format_macros.h
  86. 3 3
      src/butil/gtest_prod_util.h
  87. 6 6
      src/butil/guid.h
  88. 4 4
      src/butil/hash.h
  89. 6 6
      src/butil/intrusive_ptr.hpp
  90. 4 4
      src/butil/iobuf.cpp
  91. 3 3
      src/butil/iobuf.h
  92. 3 3
      src/butil/iobuf_inl.h
  93. 5 5
      src/butil/lazy_instance.h
  94. 3 3
      src/butil/linux_magic.h
  95. 1 1
      src/butil/location.cc
  96. 6 6
      src/butil/location.h
  97. 2 2
      src/butil/logging.cc
  98. 25 25
      src/butil/logging.h
  99. 15 15
      src/butil/macros.h
  100. 10 10
      src/butil/md5.h

+ 1 - 1
example/memcache_c++/client.cpp

@@ -36,7 +36,7 @@ DEFINE_int32(batch, 1, "Pipelined Operations");
 
 bvar::LatencyRecorder g_latency_recorder("client");
 bvar::Adder<int> g_error_count("client_error_count");
-butil::static_atomic<int> g_sender_count = BASE_STATIC_ATOMIC_INIT(0);
+butil::static_atomic<int> g_sender_count = BUTIL_STATIC_ATOMIC_INIT(0);
 
 static void* sender(void* arg) {
     google::protobuf::RpcChannel* channel = 

+ 1 - 1
example/multi_threaded_echo_fns_c++/client.cpp

@@ -43,7 +43,7 @@ std::string g_attachment;
 
 bvar::LatencyRecorder g_latency_recorder("client");
 bvar::Adder<int> g_error_count("client_error_count");
-butil::static_atomic<int> g_sender_count = BASE_STATIC_ATOMIC_INIT(0);
+butil::static_atomic<int> g_sender_count = BUTIL_STATIC_ATOMIC_INIT(0);
 
 static void* sender(void* arg) {
     // Normally, you should not call a Channel directly, but instead construct

+ 1 - 1
src/brpc/details/usercode_backup_pool.cpp

@@ -62,7 +62,7 @@ struct UserCodeBackupPool {
 static pthread_mutex_t s_usercode_mutex = PTHREAD_MUTEX_INITIALIZER;
 static pthread_cond_t s_usercode_cond = PTHREAD_COND_INITIALIZER;
 static pthread_once_t s_usercode_init = PTHREAD_ONCE_INIT;
-butil::static_atomic<int> g_usercode_inplace = BASE_STATIC_ATOMIC_INIT(0);
+butil::static_atomic<int> g_usercode_inplace = BUTIL_STATIC_ATOMIC_INIT(0);
 bool g_too_many_usercode = false;
 static UserCodeBackupPool* s_usercode_pool = NULL;
 

+ 1 - 1
src/brpc/input_messenger.h

@@ -121,7 +121,7 @@ private:
 };
 
 // Get the global InputMessenger at client-side.
-BASE_FORCE_INLINE InputMessenger* get_client_side_messenger() {
+BUTIL_FORCE_INLINE InputMessenger* get_client_side_messenger() {
     extern InputMessenger* g_messenger;
     return g_messenger;
 }

+ 1 - 1
src/brpc/load_balancer.cpp

@@ -25,7 +25,7 @@ DEFINE_bool(show_lb_in_vars, false, "Describe LoadBalancers in vars");
 BRPC_VALIDATE_GFLAG(show_lb_in_vars, PassValidate);
 
 // For assigning unique names for lb.
-static butil::static_atomic<int> g_lb_counter = BASE_STATIC_ATOMIC_INIT(0);
+static butil::static_atomic<int> g_lb_counter = BUTIL_STATIC_ATOMIC_INIT(0);
 
 void SharedLoadBalancer::DescribeLB(std::ostream& os, void* arg) {
     (static_cast<SharedLoadBalancer*>(arg))->Describe(os, DescribeOptions());

+ 3 - 3
src/brpc/log.h

@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#ifndef BAIDU_RPC_LOG_H
-#define BAIDU_RPC_LOG_H
+#ifndef BRPC_LOG_H
+#define BRPC_LOG_H
 
 #include <bthread/errno.h>
 #include <inttypes.h>  // PRId64 PRIu64
@@ -25,4 +25,4 @@
 #define RPC_VLOG_IF(cond)  VLOG_IF(RPC_VLOG_LEVEL, (cond))
 #define RPC_VPLOG_IF(cond) VPLOG_IF(RPC_VLOG_LEVEL, (cond))
 
-#endif  // BAIDU_RPC_LOG_H
+#endif  // BRPC_LOG_H

+ 1 - 1
src/brpc/protocol.cpp

@@ -194,7 +194,7 @@ const char* ProtocolTypeToString(ProtocolType type) {
     return "unknown";
 }
 
-BASE_FORCE_INLINE bool ParsePbFromZeroCopyStreamInlined(
+BUTIL_FORCE_INLINE bool ParsePbFromZeroCopyStreamInlined(
     google::protobuf::Message* msg,
     google::protobuf::io::ZeroCopyInputStream* input) {
     google::protobuf::io::CodedInputStream decoder(input);

+ 1 - 1
src/brpc/server.cpp

@@ -98,7 +98,7 @@ const char* status_str(Server::Status s) {
     return "UNKNOWN_STATUS";
 }
 
-butil::static_atomic<int> g_running_server_count = BASE_STATIC_ATOMIC_INIT(0);
+butil::static_atomic<int> g_running_server_count = BUTIL_STATIC_ATOMIC_INIT(0);
 
 DEFINE_bool(reuse_addr, true, "Bind to ports in TIME_WAIT state");
 BRPC_VALIDATE_GFLAG(reuse_addr, PassValidate);

+ 1 - 1
src/brpc/server_id.h

@@ -76,7 +76,7 @@ private:
 } // namespace brpc
 
 
-namespace BASE_HASH_NAMESPACE {
+namespace BUTIL_HASH_NAMESPACE {
 #if defined(COMPILER_GCC)
 template<>
 struct hash<brpc::ServerId> {

+ 6 - 6
src/brpc/socket_inl.h

@@ -21,30 +21,30 @@
 namespace brpc {
 
 // Utility functions to combine and extract SocketId.
-BASE_FORCE_INLINE SocketId
+BUTIL_FORCE_INLINE SocketId
 MakeSocketId(uint32_t version, butil::ResourceId<Socket> slot) {
     return SocketId((((uint64_t)version) << 32) | slot.value);
 }
 
-BASE_FORCE_INLINE butil::ResourceId<Socket> SlotOfSocketId(SocketId sid) {
+BUTIL_FORCE_INLINE butil::ResourceId<Socket> SlotOfSocketId(SocketId sid) {
     butil::ResourceId<Socket> id = { (sid & 0xFFFFFFFFul) };
     return id;
 }
 
-BASE_FORCE_INLINE uint32_t VersionOfSocketId(SocketId sid) {
+BUTIL_FORCE_INLINE uint32_t VersionOfSocketId(SocketId sid) {
     return (uint32_t)(sid >> 32);
 }
 
 // Utility functions to combine and extract Socket::_versioned_ref
-BASE_FORCE_INLINE uint32_t VersionOfVRef(uint64_t vref) {
+BUTIL_FORCE_INLINE uint32_t VersionOfVRef(uint64_t vref) {
     return (uint32_t)(vref >> 32);
 }
 
-BASE_FORCE_INLINE int32_t NRefOfVRef(uint64_t vref) {
+BUTIL_FORCE_INLINE int32_t NRefOfVRef(uint64_t vref) {
     return (int32_t)(vref & 0xFFFFFFFFul);
 }
 
-BASE_FORCE_INLINE uint64_t MakeVRef(uint32_t version, int32_t nref) {
+BUTIL_FORCE_INLINE uint64_t MakeVRef(uint32_t version, int32_t nref) {
     // 1: Intended conversion to uint32_t, nref=-1 is 00000000FFFFFFFF
     return (((uint64_t)version) << 32) | (uint32_t/*1*/)nref;
 }

+ 1 - 1
src/brpc/socket_map.cpp

@@ -50,7 +50,7 @@ DEFINE_bool(show_socketmap_in_vars, false,
 BRPC_VALIDATE_GFLAG(show_socketmap_in_vars, PassValidate);
 
 static pthread_once_t g_socket_map_init = PTHREAD_ONCE_INIT;
-static butil::static_atomic<SocketMap*> g_socket_map = BASE_STATIC_ATOMIC_INIT(NULL);
+static butil::static_atomic<SocketMap*> g_socket_map = BUTIL_STATIC_ATOMIC_INIT(NULL);
 
 class GlobalSocketCreator : public SocketCreator {
 public:

+ 1 - 1
src/bthread/bthread.cpp

@@ -81,7 +81,7 @@ inline TaskControl* get_or_new_task_control() {
 
 __thread TaskGroup* tls_task_group_nosignal = NULL;
 
-BASE_FORCE_INLINE int
+BUTIL_FORCE_INLINE int
 start_from_non_worker(bthread_t* __restrict tid,
                       const bthread_attr_t* __restrict attr,
                       void * (*fn)(void*),

+ 1 - 1
src/bthread/fd.cpp

@@ -93,7 +93,7 @@ typedef butil::atomic<int> EpollButex;
 static EpollButex* const CLOSING_GUARD = (EpollButex*)(intptr_t)-1L;
 
 #ifndef NDEBUG
-butil::static_atomic<int> break_nums = BASE_STATIC_ATOMIC_INIT(0);
+butil::static_atomic<int> break_nums = BUTIL_STATIC_ATOMIC_INIT(0);
 #endif
 
 // Able to address 67108864 file descriptors, should be enough.

+ 2 - 2
src/bthread/key.cpp

@@ -66,8 +66,8 @@ static size_t nkey = 0;
 static uint32_t s_free_keys[KEYS_MAX];
 
 // Stats.
-static butil::static_atomic<size_t> nkeytable = BASE_STATIC_ATOMIC_INIT(0);
-static butil::static_atomic<size_t> nsubkeytable = BASE_STATIC_ATOMIC_INIT(0);
+static butil::static_atomic<size_t> nkeytable = BUTIL_STATIC_ATOMIC_INIT(0);
+static butil::static_atomic<size_t> nsubkeytable = BUTIL_STATIC_ATOMIC_INIT(0);
 
 // The second-level array.
 // Align with cacheline to avoid false sharing.

+ 5 - 5
src/bthread/mutex.cpp

@@ -295,7 +295,7 @@ void SampledContention::destroy() {
 }
 
 // Remember the conflict hashes for troubleshooting, should be 0 at most of time.
-static butil::static_atomic<int64_t> g_nconflicthash = BASE_STATIC_ATOMIC_INIT(0);
+static butil::static_atomic<int64_t> g_nconflicthash = BUTIL_STATIC_ATOMIC_INIT(0);
 static int64_t get_nconflicthash(void*) {
     return g_nconflicthash.load(butil::memory_order_relaxed);
 }
@@ -351,12 +351,12 @@ void ContentionProfilerStop() {
     LOG(ERROR) << "Contention profiler is not started!";
 }
 
-BASE_FORCE_INLINE bool
+BUTIL_FORCE_INLINE bool
 is_contention_site_valid(const bthread_contention_site_t& cs) {
     return cs.sampling_range;
 }
 
-BASE_FORCE_INLINE void
+BUTIL_FORCE_INLINE void
 make_contention_site_invalid(bthread_contention_site_t* cs) {
     cs->sampling_range = 0;
 }
@@ -508,7 +508,7 @@ void submit_contention(const bthread_contention_site_t& csite, int64_t now_ns) {
     tls_inside_lock = false;
 }
 
-BASE_FORCE_INLINE int pthread_mutex_lock_impl(pthread_mutex_t* mutex) {
+BUTIL_FORCE_INLINE int pthread_mutex_lock_impl(pthread_mutex_t* mutex) {
     // Don't change behavior of lock when profiler is off.
     if (!g_cp ||
         // collecting code including backtrace() and submit() may call
@@ -560,7 +560,7 @@ BASE_FORCE_INLINE int pthread_mutex_lock_impl(pthread_mutex_t* mutex) {
     return rc;
 }
 
-BASE_FORCE_INLINE int pthread_mutex_unlock_impl(pthread_mutex_t* mutex) {
+BUTIL_FORCE_INLINE int pthread_mutex_unlock_impl(pthread_mutex_t* mutex) {
     // Don't change behavior of unlock when profiler is off.
     if (!g_cp || tls_inside_lock) {
         // This branch brings an issue that an entry created by

+ 1 - 1
src/bthread/stack.cpp

@@ -43,7 +43,7 @@ BAIDU_CASSERT(BTHREAD_STACKTYPE_NORMAL == STACK_TYPE_NORMAL, must_match);
 BAIDU_CASSERT(BTHREAD_STACKTYPE_LARGE == STACK_TYPE_LARGE, must_match);
 BAIDU_CASSERT(STACK_TYPE_MAIN == 0, must_be_0);
 
-static butil::static_atomic<int64_t> s_stack_count = BASE_STATIC_ATOMIC_INIT(0);
+static butil::static_atomic<int64_t> s_stack_count = BUTIL_STATIC_ATOMIC_INIT(0);
 static int64_t get_stack_count(void*) {
     return s_stack_count.load(butil::memory_order_relaxed);
 }

+ 4 - 4
src/butil/at_exit.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_AT_EXIT_H_
-#define BASE_AT_EXIT_H_
+#ifndef BUTIL_AT_EXIT_H_
+#define BUTIL_AT_EXIT_H_
 
 #include <stack>
 
@@ -27,7 +27,7 @@ namespace butil {
 // When the exit_manager object goes out of scope, all the registered
 // callbacks and singleton destructors will be called.
 
-class BASE_EXPORT AtExitManager {
+class BUTIL_EXPORT AtExitManager {
  public:
   typedef void (*AtExitCallbackType)(void*);
 
@@ -73,4 +73,4 @@ class ShadowingAtExitManager : public AtExitManager {
 
 }  // namespace butil
 
-#endif  // BASE_AT_EXIT_H_
+#endif  // BUTIL_AT_EXIT_H_

+ 3 - 3
src/butil/atomic_ref_count.h

@@ -8,8 +8,8 @@
 // The implementation includes annotations to avoid some false positives
 // when using data race detection tools.
 
-#ifndef BASE_ATOMIC_REF_COUNT_H_
-#define BASE_ATOMIC_REF_COUNT_H_
+#ifndef BUTIL_ATOMIC_REF_COUNT_H_
+#define BUTIL_ATOMIC_REF_COUNT_H_
 
 #include "butil/atomicops.h"
 #include "butil/third_party/dynamic_annotations/dynamic_annotations.h"
@@ -77,4 +77,4 @@ inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) {
 
 }  // namespace butil
 
-#endif  // BASE_ATOMIC_REF_COUNT_H_
+#endif  // BUTIL_ATOMIC_REF_COUNT_H_

+ 3 - 3
src/butil/atomic_sequence_num.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_ATOMIC_SEQUENCE_NUM_H_
-#define BASE_ATOMIC_SEQUENCE_NUM_H_
+#ifndef BUTIL_ATOMIC_SEQUENCE_NUM_H_
+#define BUTIL_ATOMIC_SEQUENCE_NUM_H_
 
 #include "butil/atomicops.h"
 #include "butil/basictypes.h"
@@ -57,4 +57,4 @@ class AtomicSequenceNumber {
 
 }  // namespace butil
 
-#endif  // BASE_ATOMIC_SEQUENCE_NUM_H_
+#endif  // BUTIL_ATOMIC_SEQUENCE_NUM_H_

+ 8 - 8
src/butil/atomicops.h

@@ -25,8 +25,8 @@
 // to use these.
 //
 
-#ifndef BASE_ATOMICOPS_H_
-#define BASE_ATOMICOPS_H_
+#ifndef BUTIL_ATOMICOPS_H_
+#define BUTIL_ATOMICOPS_H_
 
 #include <stdint.h>
 
@@ -166,7 +166,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
 #endif
 
 // ========= Provide butil::atomic<T> =========
-#if defined(BASE_CXX11_ENABLED)
+#if defined(BUTIL_CXX11_ENABLED)
 
 // gcc supports atomic thread fence since 4.8 checkout
 // https://gcc.gnu.org/gcc-4.7/cxx0x_status.html and
@@ -189,7 +189,7 @@ Atomic64 Release_Load(volatile const Atomic64* ptr);
 
 namespace std {
 
-BASE_FORCE_INLINE void atomic_thread_fence(memory_order v) {
+BUTIL_FORCE_INLINE void atomic_thread_fence(memory_order v) {
     switch (v) {
     case memory_order_relaxed:
         break;
@@ -205,7 +205,7 @@ BASE_FORCE_INLINE void atomic_thread_fence(memory_order v) {
     }
 }
 
-BASE_FORCE_INLINE void atomic_signal_fence(memory_order v) {
+BUTIL_FORCE_INLINE void atomic_signal_fence(memory_order v) {
     if (v != memory_order_relaxed) {
         __asm__ __volatile__("" : : : "memory");
     }
@@ -274,12 +274,12 @@ private:
 // static_atomic<> is a work-around for C++03 to declare global atomics
 // w/o constructing-order issues. It can also used in C++11 though.
 // Example:
-//   butil::static_atomic<int> g_counter = BASE_STATIC_ATOMIC_INIT(0);
+//   butil::static_atomic<int> g_counter = BUTIL_STATIC_ATOMIC_INIT(0);
 // Notice that to make static_atomic work for C++03, it cannot be
 // initialized by a constructor. Following code is wrong:
 //   butil::static_atomic<int> g_counter(0); // Not compile
 
-#define BASE_STATIC_ATOMIC_INIT(val) { (val) }
+#define BUTIL_STATIC_ATOMIC_INIT(val) { (val) }
 
 namespace butil {
 template <typename T> struct static_atomic {
@@ -317,4 +317,4 @@ private:
 };
 } // namespace butil
 
-#endif  // BASE_ATOMICOPS_H_
+#endif  // BUTIL_ATOMICOPS_H_

+ 3 - 3
src/butil/atomicops_internals_arm64_gcc.h

@@ -10,8 +10,8 @@
 //                 exclusive load / store assembly instructions and do away with
 //                 the barriers.
 
-#ifndef BASE_ATOMICOPS_INTERNALS_ARM64_GCC_H_
-#define BASE_ATOMICOPS_INTERNALS_ARM64_GCC_H_
+#ifndef BUTIL_ATOMICOPS_INTERNALS_ARM64_GCC_H_
+#define BUTIL_ATOMICOPS_INTERNALS_ARM64_GCC_H_
 
 #if defined(OS_QNX)
 #include <sys/cpuinline.h>
@@ -304,4 +304,4 @@ inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
 }  // namespace butil::subtle
 }  // namespace butil
 
-#endif  // BASE_ATOMICOPS_INTERNALS_ARM64_GCC_H_
+#endif  // BUTIL_ATOMICOPS_INTERNALS_ARM64_GCC_H_

+ 3 - 3
src/butil/atomicops_internals_arm_gcc.h

@@ -6,8 +6,8 @@
 //
 // LinuxKernelCmpxchg and Barrier_AtomicIncrement are from Google Gears.
 
-#ifndef BASE_ATOMICOPS_INTERNALS_ARM_GCC_H_
-#define BASE_ATOMICOPS_INTERNALS_ARM_GCC_H_
+#ifndef BUTIL_ATOMICOPS_INTERNALS_ARM_GCC_H_
+#define BUTIL_ATOMICOPS_INTERNALS_ARM_GCC_H_
 
 #if defined(OS_QNX)
 #include <sys/cpuinline.h>
@@ -291,4 +291,4 @@ inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
 }  // namespace butil::subtle
 }  // namespace butil
 
-#endif  // BASE_ATOMICOPS_INTERNALS_ARM_GCC_H_
+#endif  // BUTIL_ATOMICOPS_INTERNALS_ARM_GCC_H_

+ 3 - 3
src/butil/atomicops_internals_atomicword_compat.h

@@ -4,8 +4,8 @@
 
 // This file is an internal atomic implementation, use butil/atomicops.h instead.
 
-#ifndef BASE_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_
-#define BASE_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_
+#ifndef BUTIL_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_
+#define BUTIL_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_
 
 // AtomicWord is a synonym for intptr_t, and Atomic32 is a synonym for int32_t,
 // which in turn means int. On some LP32 platforms, intptr_t is an int, but
@@ -97,4 +97,4 @@ inline AtomicWord Release_Load(volatile const AtomicWord* ptr) {
 
 #endif  // !defined(ARCH_CPU_64_BITS)
 
-#endif  // BASE_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_
+#endif  // BUTIL_ATOMICOPS_INTERNALS_ATOMICWORD_COMPAT_H_

+ 3 - 3
src/butil/atomicops_internals_gcc.h

@@ -6,8 +6,8 @@
 // instead. This file is for platforms that use GCC intrinsics rather than
 // platform-specific assembly code for atomic operations.
 
-#ifndef BASE_ATOMICOPS_INTERNALS_GCC_H_
-#define BASE_ATOMICOPS_INTERNALS_GCC_H_
+#ifndef BUTIL_ATOMICOPS_INTERNALS_GCC_H_
+#define BUTIL_ATOMICOPS_INTERNALS_GCC_H_
 
 namespace butil {
 namespace subtle {
@@ -102,4 +102,4 @@ inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
 }  // namespace butil::subtle
 }  // namespace butil
 
-#endif  // BASE_ATOMICOPS_INTERNALS_GCC_H_
+#endif  // BUTIL_ATOMICOPS_INTERNALS_GCC_H_

+ 3 - 3
src/butil/atomicops_internals_mac.h

@@ -4,8 +4,8 @@
 
 // This file is an internal atomic implementation, use butil/atomicops.h instead.
 
-#ifndef BASE_ATOMICOPS_INTERNALS_MAC_H_
-#define BASE_ATOMICOPS_INTERNALS_MAC_H_
+#ifndef BUTIL_ATOMICOPS_INTERNALS_MAC_H_
+#define BUTIL_ATOMICOPS_INTERNALS_MAC_H_
 
 #include <libkern/OSAtomic.h>
 
@@ -194,4 +194,4 @@ inline Atomic64 Release_Load(volatile const Atomic64* ptr) {
 }   // namespace butil::subtle
 }   // namespace butil
 
-#endif  // BASE_ATOMICOPS_INTERNALS_MAC_H_
+#endif  // BUTIL_ATOMICOPS_INTERNALS_MAC_H_

+ 3 - 3
src/butil/atomicops_internals_mips_gcc.h

@@ -6,8 +6,8 @@
 //
 // LinuxKernelCmpxchg and Barrier_AtomicIncrement are from Google Gears.
 
-#ifndef BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_
-#define BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_
+#ifndef BUTIL_ATOMICOPS_INTERNALS_MIPS_GCC_H_
+#define BUTIL_ATOMICOPS_INTERNALS_MIPS_GCC_H_
 
 namespace butil {
 namespace subtle {
@@ -151,4 +151,4 @@ inline Atomic32 Release_Load(volatile const Atomic32* ptr) {
 } // namespace butil::subtle
 } // namespace butil
 
-#endif  // BASE_ATOMICOPS_INTERNALS_MIPS_GCC_H_
+#endif  // BUTIL_ATOMICOPS_INTERNALS_MIPS_GCC_H_

+ 3 - 3
src/butil/atomicops_internals_tsan.h

@@ -5,8 +5,8 @@
 // This file is an internal atomic implementation for compiler-based
 // ThreadSanitizer. Use butil/atomicops.h instead.
 
-#ifndef BASE_ATOMICOPS_INTERNALS_TSAN_H_
-#define BASE_ATOMICOPS_INTERNALS_TSAN_H_
+#ifndef BUTIL_ATOMICOPS_INTERNALS_TSAN_H_
+#define BUTIL_ATOMICOPS_INTERNALS_TSAN_H_
 
 #include <sanitizer/tsan_interface_atomic.h>
 
@@ -183,4 +183,4 @@ inline void MemoryBarrier() {
 }  // namespace butil::subtle
 }  // namespace butil
 
-#endif  // BASE_ATOMICOPS_INTERNALS_TSAN_H_
+#endif  // BUTIL_ATOMICOPS_INTERNALS_TSAN_H_

+ 2 - 2
src/butil/atomicops_internals_x86_gcc.cc

@@ -14,7 +14,7 @@
 // depends on structs that are defined in that file.  If atomicops.h
 // doesn't sub-include that file, then we aren't needed, and shouldn't
 // try to do anything.
-#ifdef BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
+#ifdef BUTIL_ATOMICOPS_INTERNALS_X86_GCC_H_
 
 // Inline cpuid instruction.  In PIC compilations, %ebx contains the address
 // of the global offset table.  To avoid breaking such executables, this code
@@ -97,4 +97,4 @@ AtomicOpsx86Initializer g_initer;
 
 #endif  // if x86
 
-#endif  // ifdef BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
+#endif  // ifdef BUTIL_ATOMICOPS_INTERNALS_X86_GCC_H_

+ 5 - 5
src/butil/atomicops_internals_x86_gcc.h

@@ -4,13 +4,13 @@
 
 // This file is an internal atomic implementation, use butil/atomicops.h instead.
 
-#ifndef BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
-#define BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
+#ifndef BUTIL_ATOMICOPS_INTERNALS_X86_GCC_H_
+#define BUTIL_ATOMICOPS_INTERNALS_X86_GCC_H_
 
 #include "butil/base_export.h"
 
 // This struct is not part of the public API of this module; clients may not
-// use it.  (However, it's exported via BASE_EXPORT because clients implicitly
+// use it.  (However, it's exported via BUTIL_EXPORT because clients implicitly
 // do use it at link time by inlining these functions.)
 // Features of this x86.  Values may not be correct before main() is run,
 // but are set conservatively.
@@ -18,7 +18,7 @@ struct AtomicOps_x86CPUFeatureStruct {
   bool has_amd_lock_mb_bug; // Processor has AMD memory-barrier bug; do lfence
                             // after acquire compare-and-swap.
 };
-BASE_EXPORT extern struct AtomicOps_x86CPUFeatureStruct
+BUTIL_EXPORT extern struct AtomicOps_x86CPUFeatureStruct
     AtomicOps_Internalx86CPUFeatures;
 
 #define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
@@ -239,4 +239,4 @@ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
 
 #undef ATOMICOPS_COMPILER_BARRIER
 
-#endif  // BASE_ATOMICOPS_INTERNALS_X86_GCC_H_
+#endif  // BUTIL_ATOMICOPS_INTERNALS_X86_GCC_H_

+ 3 - 3
src/butil/atomicops_internals_x86_msvc.h

@@ -4,8 +4,8 @@
 
 // This file is an internal atomic implementation, use butil/atomicops.h instead.
 
-#ifndef BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_
-#define BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_
+#ifndef BUTIL_ATOMICOPS_INTERNALS_X86_MSVC_H_
+#define BUTIL_ATOMICOPS_INTERNALS_X86_MSVC_H_
 
 #include <windows.h>
 
@@ -195,4 +195,4 @@ inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
 }  // namespace butil::subtle
 }  // namespace butil
 
-#endif  // BASE_ATOMICOPS_INTERNALS_X86_MSVC_H_
+#endif  // BUTIL_ATOMICOPS_INTERNALS_X86_MSVC_H_

+ 3 - 3
src/butil/auto_reset.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_AUTO_RESET_H_
-#define BASE_AUTO_RESET_H_
+#ifndef BUTIL_AUTO_RESET_H_
+#define BUTIL_AUTO_RESET_H_
 
 #include "butil/basictypes.h"
 
@@ -38,4 +38,4 @@ class AutoReset {
 
 }
 
-#endif  // BASE_AUTO_RESET_H_
+#endif  // BUTIL_AUTO_RESET_H_

+ 5 - 5
src/butil/base64.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_BASE64_H__
-#define BASE_BASE64_H__
+#ifndef BUTIL_BASE64_H__
+#define BUTIL_BASE64_H__
 
 #include <string>
 
@@ -13,12 +13,12 @@
 namespace butil {
 
 // Encodes the input string in base64.
-BASE_EXPORT void Base64Encode(const StringPiece& input, std::string* output);
+BUTIL_EXPORT void Base64Encode(const StringPiece& input, std::string* output);
 
 // Decodes the base64 input string.  Returns true if successful and false
 // otherwise.  The output string is only modified if successful.
-BASE_EXPORT bool Base64Decode(const StringPiece& input, std::string* output);
+BUTIL_EXPORT bool Base64Decode(const StringPiece& input, std::string* output);
 
 }  // namespace butil
 
-#endif  // BASE_BASE64_H__
+#endif  // BUTIL_BASE64_H__

+ 17 - 17
src/butil/base_export.h

@@ -2,33 +2,33 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_BASE_EXPORT_H_
-#define BASE_BASE_EXPORT_H_
+#ifndef BUTIL_BASE_EXPORT_H_
+#define BUTIL_BASE_EXPORT_H_
 
 #if defined(COMPONENT_BUILD)
 #if defined(WIN32)
 
-#if defined(BASE_IMPLEMENTATION)
-#define BASE_EXPORT __declspec(dllexport)
-#define BASE_EXPORT_PRIVATE __declspec(dllexport)
+#if defined(BUTIL_IMPLEMENTATION)
+#define BUTIL_EXPORT __declspec(dllexport)
+#define BUTIL_EXPORT_PRIVATE __declspec(dllexport)
 #else
-#define BASE_EXPORT __declspec(dllimport)
-#define BASE_EXPORT_PRIVATE __declspec(dllimport)
-#endif  // defined(BASE_IMPLEMENTATION)
+#define BUTIL_EXPORT __declspec(dllimport)
+#define BUTIL_EXPORT_PRIVATE __declspec(dllimport)
+#endif  // defined(BUTIL_IMPLEMENTATION)
 
 #else  // defined(WIN32)
-#if defined(BASE_IMPLEMENTATION)
-#define BASE_EXPORT __attribute__((visibility("default")))
-#define BASE_EXPORT_PRIVATE __attribute__((visibility("default")))
+#if defined(BUTIL_IMPLEMENTATION)
+#define BUTIL_EXPORT __attribute__((visibility("default")))
+#define BUTIL_EXPORT_PRIVATE __attribute__((visibility("default")))
 #else
-#define BASE_EXPORT
-#define BASE_EXPORT_PRIVATE
-#endif  // defined(BASE_IMPLEMENTATION)
+#define BUTIL_EXPORT
+#define BUTIL_EXPORT_PRIVATE
+#endif  // defined(BUTIL_IMPLEMENTATION)
 #endif
 
 #else  // defined(COMPONENT_BUILD)
-#define BASE_EXPORT
-#define BASE_EXPORT_PRIVATE
+#define BUTIL_EXPORT
+#define BUTIL_EXPORT_PRIVATE
 #endif
 
-#endif  // BASE_BASE_EXPORT_H_
+#endif  // BUTIL_BASE_EXPORT_H_

+ 3 - 3
src/butil/basictypes.h

@@ -8,8 +8,8 @@
 // Note that the macros and macro-like constructs that were formerly defined in
 // this file are now available separately in butil/macros.h.
 
-#ifndef BASE_BASICTYPES_H_
-#define BASE_BASICTYPES_H_
+#ifndef BUTIL_BASICTYPES_H_
+#define BUTIL_BASICTYPES_H_
 
 #include <limits.h>  // So we can set the bounds of our types.
 #include <stddef.h>  // For size_t.
@@ -32,4 +32,4 @@ const  int32_t kint32max  = (( int32_t) 0x7FFFFFFF);
 const  int64_t kint64min  = (( int64_t) 0x8000000000000000LL);
 const  int64_t kint64max  = (( int64_t) 0x7FFFFFFFFFFFFFFFLL);
 
-#endif  // BASE_BASICTYPES_H_
+#endif  // BUTIL_BASICTYPES_H_

+ 5 - 5
src/butil/big_endian.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_BIG_ENDIAN_H_
-#define BASE_BIG_ENDIAN_H_
+#ifndef BUTIL_BIG_ENDIAN_H_
+#define BUTIL_BIG_ENDIAN_H_
 
 #include "butil/base_export.h"
 #include "butil/basictypes.h"
@@ -49,7 +49,7 @@ inline void WriteBigEndian<uint8_t>(char buf[], uint8_t val) {
 
 // Allows reading integers in network order (big endian) while iterating over
 // an underlying buffer. All the reading functions advance the internal pointer.
-class BASE_EXPORT BigEndianReader {
+class BUTIL_EXPORT BigEndianReader {
  public:
   BigEndianReader(const char* buf, size_t len);
 
@@ -75,7 +75,7 @@ class BASE_EXPORT BigEndianReader {
 
 // Allows writing integers in network order (big endian) while iterating over
 // an underlying buffer. All the writing functions advance the internal pointer.
-class BASE_EXPORT BigEndianWriter {
+class BUTIL_EXPORT BigEndianWriter {
  public:
   BigEndianWriter(char* buf, size_t len);
 
@@ -99,4 +99,4 @@ class BASE_EXPORT BigEndianWriter {
 
 }  // namespace butil
 
-#endif  // BASE_BIG_ENDIAN_H_
+#endif  // BUTIL_BIG_ENDIAN_H_

+ 3 - 3
src/butil/bit_array.h

@@ -19,8 +19,8 @@
 // are not threadsafe because operations on different bits may modify a same
 // integer.
 
-#ifndef BASE_BIT_ARRAY_H
-#define BASE_BIT_ARRAY_H
+#ifndef BUTIL_BIT_ARRAY_H
+#define BUTIL_BIT_ARRAY_H
 
 #include <stdint.h>
 
@@ -98,4 +98,4 @@ inline size_t bit_array_first1(const uint64_t* array, size_t begin, size_t end)
 
 }  // end namespace butil
 
-#endif  // BASE_BIT_ARRAY_H
+#endif  // BUTIL_BIT_ARRAY_H

+ 3 - 3
src/butil/bits.h

@@ -4,8 +4,8 @@
 
 // This file defines some bit utilities.
 
-#ifndef BASE_BITS_H_
-#define BASE_BITS_H_
+#ifndef BUTIL_BITS_H_
+#define BUTIL_BITS_H_
 
 #include "butil/basictypes.h"
 #include "butil/logging.h"
@@ -44,4 +44,4 @@ inline int Log2Ceiling(uint32_t n) {
 }  // namespace bits
 }  // namespace butil
 
-#endif  // BASE_BITS_H_
+#endif  // BUTIL_BITS_H_

+ 6 - 6
src/butil/build_config.h

@@ -12,8 +12,8 @@
 //    ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
 //    ARCH_CPU_32_BITS / ARCH_CPU_64_BITS
 
-#ifndef BASE_BUILD_CONFIG_H_
-#define BASE_BUILD_CONFIG_H_
+#ifndef BUTIL_BUILD_CONFIG_H_
+#define BUTIL_BUILD_CONFIG_H_
 
 // A set of macros to use for platform detection.
 #if defined(__native_client__)
@@ -162,17 +162,17 @@
 #define STD_STRING_ITERATOR_IS_CHAR_POINTER
 // The compiler thinks butil::string16::const_iterator and "char16*" are
 // equivalent types.
-#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
+#define BUTIL_STRING16_ITERATOR_IS_CHAR16_POINTER
 #endif
 
 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
-#define BASE_CXX11_ENABLED 1
+#define BUTIL_CXX11_ENABLED 1
 #endif
 
-#if !defined(BASE_CXX11_ENABLED)
+#if !defined(BUTIL_CXX11_ENABLED)
 #define nullptr NULL
 #endif
 
 #define HAVE_DLADDR
 
-#endif  // BASE_BUILD_CONFIG_H_
+#endif  // BUTIL_BUILD_CONFIG_H_

+ 3 - 3
src/butil/cancelable_callback.h

@@ -39,8 +39,8 @@
 // timeout.Cancel();  // Hopefully this is hit before the timeout callback runs.
 //
 
-#ifndef BASE_CANCELABLE_CALLBACK_H_
-#define BASE_CANCELABLE_CALLBACK_H_
+#ifndef BUTIL_CANCELABLE_CALLBACK_H_
+#define BUTIL_CANCELABLE_CALLBACK_H_
 
 #include "butil/base_export.h"
 #include "butil/bind.h"
@@ -269,4 +269,4 @@ typedef CancelableCallback<void(void)> CancelableClosure;
 
 }  // namespace butil
 
-#endif  // BASE_CANCELABLE_CALLBACK_H_
+#endif  // BUTIL_CANCELABLE_CALLBACK_H_

+ 3 - 3
src/butil/comlog_sink.h

@@ -17,8 +17,8 @@
 
 // Redirect LOG() into comlog.
 
-#ifndef BASE_COMLOG_SINK_H
-#define BASE_COMLOG_SINK_H
+#ifndef BUTIL_COMLOG_SINK_H
+#define BUTIL_COMLOG_SINK_H
 
 #include "butil/logging.h"
 
@@ -161,4 +161,4 @@ private:
 
 }  // namespace logging
 
-#endif  // BASE_COMLOG_SINK_H
+#endif  // BUTIL_COMLOG_SINK_H

+ 8 - 8
src/butil/compiler_specific.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_COMPILER_SPECIFIC_H_
-#define BASE_COMPILER_SPECIFIC_H_
+#ifndef BUTIL_COMPILER_SPECIFIC_H_
+#define BUTIL_COMPILER_SPECIFIC_H_
 
 #include "butil/build_config.h"
 
@@ -112,13 +112,13 @@
 #define NOINLINE
 #endif
 
-#ifndef BASE_FORCE_INLINE
+#ifndef BUTIL_FORCE_INLINE
 #if defined(COMPILER_MSVC)
-#define BASE_FORCE_INLINE    __forceinline
+#define BUTIL_FORCE_INLINE    __forceinline
 #else
-#define BASE_FORCE_INLINE inline __attribute__((always_inline))
+#define BUTIL_FORCE_INLINE inline __attribute__((always_inline))
 #endif
-#endif  // BASE_FORCE_INLINE
+#endif  // BUTIL_FORCE_INLINE
 
 // Specify memory alignment for structs, classes, etc.
 // Use like:
@@ -272,11 +272,11 @@
 #endif
 
 #ifndef BAIDU_NOEXCEPT
-# if defined(BASE_CXX11_ENABLED)
+# if defined(BUTIL_CXX11_ENABLED)
 #  define BAIDU_NOEXCEPT noexcept
 # else
 #  define BAIDU_NOEXCEPT
 # endif
 #endif
 
-#endif  // BASE_COMPILER_SPECIFIC_H_
+#endif  // BUTIL_COMPILER_SPECIFIC_H_

+ 3 - 3
src/butil/containers/bounded_queue.h

@@ -20,8 +20,8 @@
 // boost::lockfree::spsc_queue or boost::lockfree::queue in multi-threaded
 // scenarios.
 
-#ifndef BASE_BOUNDED_QUEUE_H
-#define BASE_BOUNDED_QUEUE_H
+#ifndef BUTIL_BOUNDED_QUEUE_H
+#define BUTIL_BOUNDED_QUEUE_H
 
 #include "butil/macros.h"
 #include "butil/logging.h"
@@ -300,4 +300,4 @@ private:
 
 }  // namespace butil
 
-#endif  // BASE_BOUNDED_QUEUE_H
+#endif  // BUTIL_BOUNDED_QUEUE_H

+ 3 - 3
src/butil/containers/case_ignored_flat_map.h

@@ -15,8 +15,8 @@
 // Author: Ge,Jun (gejun@baidu.com)
 // Date: Sun Dec  4 14:57:27 CST 2016
 
-#ifndef BASE_CASE_IGNORED_FLAT_MAP_H
-#define BASE_CASE_IGNORED_FLAT_MAP_H
+#ifndef BUTIL_CASE_IGNORED_FLAT_MAP_H
+#define BUTIL_CASE_IGNORED_FLAT_MAP_H
 
 #include "butil/containers/flat_map.h"
 
@@ -67,4 +67,4 @@ class CaseIgnoredFlatSet : public butil::FlatMap<
 
 } // namespace butil
 
-#endif  // BASE_CASE_IGNORED_FLAT_MAP_H
+#endif  // BUTIL_CASE_IGNORED_FLAT_MAP_H

+ 3 - 3
src/butil/containers/doubly_buffered_data.h

@@ -15,8 +15,8 @@
 // Author: Ge,Jun (gejun@baidu.com)
 // Date: Mon Sep 22 22:23:13 CST 2014
 
-#ifndef BASE_DOUBLY_BUFFERED_DATA_H
-#define BASE_DOUBLY_BUFFERED_DATA_H
+#ifndef BUTIL_DOUBLY_BUFFERED_DATA_H
+#define BUTIL_DOUBLY_BUFFERED_DATA_H
 
 #include <vector>                                       // std::vector
 #include <pthread.h>
@@ -414,4 +414,4 @@ size_t DoublyBufferedData<T, TLS>::ModifyWithForeground(
 
 }  // namespace butil
 
-#endif  // BASE_DOUBLY_BUFFERED_DATA_H
+#endif  // BUTIL_DOUBLY_BUFFERED_DATA_H

+ 4 - 4
src/butil/containers/flat_map.h

@@ -88,8 +88,8 @@
 //  Seeking 1000 from FlatMap/std::map/butil::PooledMap/butil::hash_map takes 4/88/89/13
 //  Seeking 10000 from FlatMap/std::map/butil::PooledMap/butil::hash_map takes 4/177/185/14
 
-#ifndef BASE_FLAT_MAP_H
-#define BASE_FLAT_MAP_H
+#ifndef BUTIL_FLAT_MAP_H
+#define BUTIL_FLAT_MAP_H
 
 #include <stdint.h>
 #include <functional>
@@ -382,7 +382,7 @@ private:
 
 // Implement DefaultHasher and DefaultEqualTo
 template <typename K>
-struct DefaultHasher : public BASE_HASH_NAMESPACE::hash<K> {
+struct DefaultHasher : public BUTIL_HASH_NAMESPACE::hash<K> {
 };
 
 template <>
@@ -480,4 +480,4 @@ _T* find_lowered_cstr(FlatMap<std::string, _T, _Hash, _Equal, _Sparse>& m,
 
 #include "butil/containers/flat_map_inl.h"
 
-#endif  //BASE_FLAT_MAP_H
+#endif  //BUTIL_FLAT_MAP_H

+ 3 - 3
src/butil/containers/flat_map_inl.h

@@ -15,8 +15,8 @@
 // Author: Ge,Jun (gejun@baidu.com)
 // Date: Wed Nov 27 12:59:20 CST 2013
 
-#ifndef BASE_FLAT_MAP_INL_H
-#define BASE_FLAT_MAP_INL_H
+#ifndef BUTIL_FLAT_MAP_INL_H
+#define BUTIL_FLAT_MAP_INL_H
 
 namespace butil {
 
@@ -646,4 +646,4 @@ typename FlatMap<_K, _T, _H, _E, _S>::const_iterator FlatMap<_K, _T, _H, _E, _S>
 
 }  // namespace butil
 
-#endif  //BASE_FLAT_MAP_INL_H
+#endif  //BUTIL_FLAT_MAP_INL_H

+ 14 - 14
src/butil/containers/hash_tables.h

@@ -18,8 +18,8 @@
 // because identity hashes are not desirable for all types that might show up
 // in containers as pointers.
 
-#ifndef BASE_CONTAINERS_HASH_TABLES_H_
-#define BASE_CONTAINERS_HASH_TABLES_H_
+#ifndef BUTIL_CONTAINERS_HASH_TABLES_H_
+#define BUTIL_CONTAINERS_HASH_TABLES_H_
 
 #include <utility>
 
@@ -31,13 +31,13 @@
 #include <hash_map>
 #include <hash_set>
 
-#define BASE_HASH_NAMESPACE stdext
+#define BUTIL_HASH_NAMESPACE stdext
 
 #elif defined(COMPILER_GCC)
 #if defined(OS_ANDROID)
-#define BASE_HASH_NAMESPACE std
+#define BUTIL_HASH_NAMESPACE std
 #else
-#define BASE_HASH_NAMESPACE __gnu_cxx
+#define BUTIL_HASH_NAMESPACE __gnu_cxx
 #endif
 
 // This is a hack to disable the gcc 4.4 warning about hash_map and hash_set
@@ -63,7 +63,7 @@
 #undef CHROME_OLD__DEPRECATED
 #endif
 
-namespace BASE_HASH_NAMESPACE {
+namespace BUTIL_HASH_NAMESPACE {
 
 #if !defined(OS_ANDROID)
 // The GNU C++ library provides identity hash functions for many integral types,
@@ -107,17 +107,17 @@ DEFINE_STRING_HASH(butil::string16);
 
 #undef DEFINE_STRING_HASH
 
-}  // namespace BASE_HASH_NAMESPACE
+}  // namespace BUTIL_HASH_NAMESPACE
 
 #else  // COMPILER
-#error define BASE_HASH_NAMESPACE for your compiler
+#error define BUTIL_HASH_NAMESPACE for your compiler
 #endif  // COMPILER
 
 namespace butil {
-using BASE_HASH_NAMESPACE::hash_map;
-using BASE_HASH_NAMESPACE::hash_multimap;
-using BASE_HASH_NAMESPACE::hash_multiset;
-using BASE_HASH_NAMESPACE::hash_set;
+using BUTIL_HASH_NAMESPACE::hash_map;
+using BUTIL_HASH_NAMESPACE::hash_multimap;
+using BUTIL_HASH_NAMESPACE::hash_multiset;
+using BUTIL_HASH_NAMESPACE::hash_set;
 
 // Implement hashing for pairs of at-most 32 bit integer values.
 // When size_t is 32 bits, we turn the 64-bit hash code into 32 bits by using
@@ -232,7 +232,7 @@ DEFINE_64BIT_PAIR_HASH(uint64_t, uint64_t);
 #undef DEFINE_64BIT_PAIR_HASH
 }  // namespace butil
 
-namespace BASE_HASH_NAMESPACE {
+namespace BUTIL_HASH_NAMESPACE {
 
 // Implement methods for hashing a pair of integers, so they can be used as
 // keys in STL containers.
@@ -274,4 +274,4 @@ struct hash<Type*> {
 #undef DEFINE_PAIR_HASH_FUNCTION_START
 #undef DEFINE_PAIR_HASH_FUNCTION_END
 
-#endif  // BASE_CONTAINERS_HASH_TABLES_H_
+#endif  // BUTIL_CONTAINERS_HASH_TABLES_H_

+ 3 - 3
src/butil/containers/linked_list.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_CONTAINERS_LINKED_LIST_H_
-#define BASE_CONTAINERS_LINKED_LIST_H_
+#ifndef BUTIL_CONTAINERS_LINKED_LIST_H_
+#define BUTIL_CONTAINERS_LINKED_LIST_H_
 
 #include "butil/macros.h"
 
@@ -193,4 +193,4 @@ class LinkedList {
 
 }  // namespace butil
 
-#endif  // BASE_CONTAINERS_LINKED_LIST_H_
+#endif  // BUTIL_CONTAINERS_LINKED_LIST_H_

+ 3 - 3
src/butil/containers/mru_cache.h

@@ -13,8 +13,8 @@
 // legibility rather than optimality. If future profiling identifies this as
 // a bottleneck, there is room for smaller values of 1 in the O(1). :]
 
-#ifndef BASE_CONTAINERS_MRU_CACHE_H_
-#define BASE_CONTAINERS_MRU_CACHE_H_
+#ifndef BUTIL_CONTAINERS_MRU_CACHE_H_
+#define BUTIL_CONTAINERS_MRU_CACHE_H_
 
 #include <list>
 #include <map>
@@ -307,4 +307,4 @@ class HashingMRUCache : public MRUCacheBase<KeyType,
 
 }  // namespace butil
 
-#endif  // BASE_CONTAINERS_MRU_CACHE_H_
+#endif  // BUTIL_CONTAINERS_MRU_CACHE_H_

+ 4 - 4
src/butil/containers/pooled_map.h

@@ -15,8 +15,8 @@
 // Author: Ge,Jun (gejun@baidu.com)
 // Date: Sat Dec  3 13:11:32 CST 2016
 
-#ifndef BASE_POOLED_MAP_H
-#define BASE_POOLED_MAP_H
+#ifndef BUTIL_POOLED_MAP_H
+#define BUTIL_POOLED_MAP_H
 
 #include "butil/single_threaded_pool.h"
 #include <new>
@@ -177,7 +177,7 @@ bool operator!=(const PooledAllocator<T1, S1>& a, const PooledAllocator<T2, S2>&
 
 // Since this allocator can't be exchanged(check impl. of operator==) nor
 // copied, specializing swap() is a must to make map.swap() work.
-#if !defined(BASE_CXX11_ENABLED)
+#if !defined(BUTIL_CXX11_ENABLED)
 #include <algorithm>  // std::swap until C++11
 #else
 #include <utility>    // std::swap since C++11
@@ -191,4 +191,4 @@ inline void swap(::butil::details::PooledAllocator<T1, BLOCK_SIZE> &lhs,
 }
 }  // namespace std
 
-#endif  // BASE_POOLED_MAP_H
+#endif  // BUTIL_POOLED_MAP_H

+ 3 - 3
src/butil/containers/scoped_ptr_hash_map.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_
-#define BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_
+#ifndef BUTIL_CONTAINERS_SCOPED_PTR_HASH_MAP_H_
+#define BUTIL_CONTAINERS_SCOPED_PTR_HASH_MAP_H_
 
 #include <algorithm>
 #include <utility>
@@ -154,4 +154,4 @@ class ScopedPtrHashMap {
 
 }  // namespace butil
 
-#endif  // BASE_CONTAINERS_SCOPED_PTR_HASH_MAP_H_
+#endif  // BUTIL_CONTAINERS_SCOPED_PTR_HASH_MAP_H_

+ 3 - 3
src/butil/containers/small_map.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_CONTAINERS_SMALL_MAP_H_
-#define BASE_CONTAINERS_SMALL_MAP_H_
+#ifndef BUTIL_CONTAINERS_SMALL_MAP_H_
+#define BUTIL_CONTAINERS_SMALL_MAP_H_
 
 #include <map>
 #include <string>
@@ -649,4 +649,4 @@ inline bool SmallMap<NormalMap, kArraySize, EqualKey,
 
 }  // namespace butil
 
-#endif  // BASE_CONTAINERS_SMALL_MAP_H_
+#endif  // BUTIL_CONTAINERS_SMALL_MAP_H_

+ 3 - 3
src/butil/containers/stack_container.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_CONTAINERS_STACK_CONTAINER_H_
-#define BASE_CONTAINERS_STACK_CONTAINER_H_
+#ifndef BUTIL_CONTAINERS_STACK_CONTAINER_H_
+#define BUTIL_CONTAINERS_STACK_CONTAINER_H_
 
 #include <string>
 #include <vector>
@@ -262,4 +262,4 @@ class StackVector : public StackContainer<
 
 }  // namespace butil
 
-#endif  // BASE_CONTAINERS_STACK_CONTAINER_H_
+#endif  // BUTIL_CONTAINERS_STACK_CONTAINER_H_

+ 4 - 4
src/butil/cpu.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_CPU_H_
-#define BASE_CPU_H_
+#ifndef BUTIL_CPU_H_
+#define BUTIL_CPU_H_
 
 #include <string>
 
@@ -12,7 +12,7 @@
 namespace butil {
 
 // Query information about the processor.
-class BASE_EXPORT CPU {
+class BUTIL_EXPORT CPU {
  public:
   // Constructor
   CPU();
@@ -87,4 +87,4 @@ class BASE_EXPORT CPU {
 
 }  // namespace butil
 
-#endif  // BASE_CPU_H_
+#endif  // BUTIL_CPU_H_

+ 3 - 3
src/butil/crc32c.h

@@ -7,8 +7,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file. See the AUTHORS file for names of contributors.
 
-#ifndef BASE_CRC32C_H
-#define BASE_CRC32C_H
+#ifndef BUTIL_CRC32C_H
+#define BUTIL_CRC32C_H
 
 #include <stddef.h>
 #include <stdint.h>
@@ -49,4 +49,4 @@ inline uint32_t Unmask(uint32_t masked_crc) {
 }  // namespace crc32c
 }  // namespace butil
 
-#endif  // BASE_CRC32C_H
+#endif  // BUTIL_CRC32C_H

+ 4 - 4
src/butil/debug/alias.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_DEBUG_ALIAS_H_
-#define BASE_DEBUG_ALIAS_H_
+#ifndef BUTIL_DEBUG_ALIAS_H_
+#define BUTIL_DEBUG_ALIAS_H_
 
 #include "butil/base_export.h"
 
@@ -13,9 +13,9 @@ namespace debug {
 // Make the optimizer think that var is aliased. This is to prevent it from
 // optimizing out variables that that would not otherwise be live at the point
 // of a potential crash.
-void BASE_EXPORT Alias(const void* var);
+void BUTIL_EXPORT Alias(const void* var);
 
 }  // namespace debug
 }  // namespace butil
 
-#endif  // BASE_DEBUG_ALIAS_H_
+#endif  // BUTIL_DEBUG_ALIAS_H_

+ 8 - 8
src/butil/debug/asan_invalid_access.h

@@ -5,8 +5,8 @@
 // Defines some functions that intentionally do an invalid memory access in
 // order to trigger an AddressSanitizer (ASan) error report.
 
-#ifndef BASE_DEBUG_ASAN_INVALID_ACCESS_H_
-#define BASE_DEBUG_ASAN_INVALID_ACCESS_H_
+#ifndef BUTIL_DEBUG_ASAN_INVALID_ACCESS_H_
+#define BUTIL_DEBUG_ASAN_INVALID_ACCESS_H_
 
 #include "butil/base_export.h"
 #include "butil/compiler_specific.h"
@@ -17,13 +17,13 @@ namespace debug {
 #if defined(ADDRESS_SANITIZER) || defined(SYZYASAN)
 
 // Generates an heap buffer overflow.
-BASE_EXPORT NOINLINE void AsanHeapOverflow();
+BUTIL_EXPORT NOINLINE void AsanHeapOverflow();
 
 // Generates an heap buffer underflow.
-BASE_EXPORT NOINLINE void AsanHeapUnderflow();
+BUTIL_EXPORT NOINLINE void AsanHeapUnderflow();
 
 // Generates an use after free.
-BASE_EXPORT NOINLINE void AsanHeapUseAfterFree();
+BUTIL_EXPORT NOINLINE void AsanHeapUseAfterFree();
 
 #endif  // ADDRESS_SANITIZER || SYZYASAN
 
@@ -33,15 +33,15 @@ BASE_EXPORT NOINLINE void AsanHeapUseAfterFree();
 
 // Corrupts a memory block and makes sure that the corruption gets detected when
 // we try to free this block.
-BASE_EXPORT NOINLINE void AsanCorruptHeapBlock();
+BUTIL_EXPORT NOINLINE void AsanCorruptHeapBlock();
 
 // Corrupts the heap and makes sure that the corruption gets detected when a
 // crash occur.
-BASE_EXPORT NOINLINE void AsanCorruptHeap();
+BUTIL_EXPORT NOINLINE void AsanCorruptHeap();
 
 #endif  // SYZYASAN
 
 }  // namespace debug
 }  // namespace butil
 
-#endif  // BASE_DEBUG_ASAN_INVALID_ACCESS_H_
+#endif  // BUTIL_DEBUG_ASAN_INVALID_ACCESS_H_

+ 14 - 14
src/butil/debug/crash_logging.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_DEBUG_CRASH_LOGGING_H_
-#define BASE_DEBUG_CRASH_LOGGING_H_
+#ifndef BUTIL_DEBUG_CRASH_LOGGING_H_
+#define BUTIL_DEBUG_CRASH_LOGGING_H_
 
 #include <string>
 #include <vector>
@@ -25,24 +25,24 @@ class StackTrace;
 
 // Set or clear a specific key-value pair from the crash metadata. Keys and
 // values are terminated at the null byte.
-BASE_EXPORT void SetCrashKeyValue(const butil::StringPiece& key,
+BUTIL_EXPORT void SetCrashKeyValue(const butil::StringPiece& key,
                                   const butil::StringPiece& value);
-BASE_EXPORT void ClearCrashKey(const butil::StringPiece& key);
+BUTIL_EXPORT void ClearCrashKey(const butil::StringPiece& key);
 
 // Records the given StackTrace into a crash key.
-BASE_EXPORT void SetCrashKeyToStackTrace(const butil::StringPiece& key,
+BUTIL_EXPORT void SetCrashKeyToStackTrace(const butil::StringPiece& key,
                                          const StackTrace& trace);
 
 // Formats |count| instruction pointers from |addresses| using %p and
 // sets the resulting string as a value for crash key |key|. A maximum of 23
 // items will be encoded, since breakpad limits values to 255 bytes.
-BASE_EXPORT void SetCrashKeyFromAddresses(const butil::StringPiece& key,
+BUTIL_EXPORT void SetCrashKeyFromAddresses(const butil::StringPiece& key,
                                           const void* const* addresses,
                                           size_t count);
 
 // A scoper that sets the specified key to value for the lifetime of the
 // object, and clears it on destruction.
-class BASE_EXPORT ScopedCrashKey {
+class BUTIL_EXPORT ScopedCrashKey {
  public:
   ScopedCrashKey(const butil::StringPiece& key, const butil::StringPiece& value);
   ~ScopedCrashKey();
@@ -54,7 +54,7 @@ class BASE_EXPORT ScopedCrashKey {
 };
 
 // Before setting values for a key, all the keys must be registered.
-struct BASE_EXPORT CrashKey {
+struct BUTIL_EXPORT CrashKey {
   // The name of the crash key, used in the above functions.
   const char* key_name;
 
@@ -70,11 +70,11 @@ struct BASE_EXPORT CrashKey {
 // the crash reporting implementation should allocate space for the registered
 // crash keys. |chunk_max_length| is the maximum size that a value in a single
 // chunk can be.
-BASE_EXPORT size_t InitCrashKeys(const CrashKey* const keys, size_t count,
+BUTIL_EXPORT size_t InitCrashKeys(const CrashKey* const keys, size_t count,
                                  size_t chunk_max_length);
 
 // Returns the correspnding crash key object or NULL for a given key.
-BASE_EXPORT const CrashKey* LookupCrashKey(const butil::StringPiece& key);
+BUTIL_EXPORT const CrashKey* LookupCrashKey(const butil::StringPiece& key);
 
 // In the platform crash reporting implementation, these functions set and
 // clear the NUL-termianted key-value pairs.
@@ -84,21 +84,21 @@ typedef void (*ClearCrashKeyValueFuncT)(const butil::StringPiece&);
 
 // Sets the function pointers that are used to integrate with the platform-
 // specific crash reporting libraries.
-BASE_EXPORT void SetCrashKeyReportingFunctions(
+BUTIL_EXPORT void SetCrashKeyReportingFunctions(
     SetCrashKeyValueFuncT set_key_func,
     ClearCrashKeyValueFuncT clear_key_func);
 
 // Helper function that breaks up a value according to the parameters
 // specified by the crash key object.
-BASE_EXPORT std::vector<std::string> ChunkCrashKeyValue(
+BUTIL_EXPORT std::vector<std::string> ChunkCrashKeyValue(
     const CrashKey& crash_key,
     const butil::StringPiece& value,
     size_t chunk_max_length);
 
 // Resets the crash key system so it can be reinitialized. For testing only.
-BASE_EXPORT void ResetCrashLoggingForTesting();
+BUTIL_EXPORT void ResetCrashLoggingForTesting();
 
 }  // namespace debug
 }  // namespace butil
 
-#endif  // BASE_DEBUG_CRASH_LOGGING_H_
+#endif  // BUTIL_DEBUG_CRASH_LOGGING_H_

+ 8 - 8
src/butil/debug/debugger.h

@@ -6,8 +6,8 @@
 // debuggers.  You should use this to test if you're running under a debugger,
 // and if you would like to yield (breakpoint) into the debugger.
 
-#ifndef BASE_DEBUG_DEBUGGER_H
-#define BASE_DEBUG_DEBUGGER_H
+#ifndef BUTIL_DEBUG_DEBUGGER_H
+#define BUTIL_DEBUG_DEBUGGER_H
 
 #include "butil/base_export.h"
 
@@ -16,7 +16,7 @@ namespace debug {
 
 // Waits wait_seconds seconds for a debugger to attach to the current process.
 // When silent is false, an exception is thrown when a debugger is detected.
-BASE_EXPORT bool WaitForDebugger(int wait_seconds, bool silent);
+BUTIL_EXPORT bool WaitForDebugger(int wait_seconds, bool silent);
 
 // Returns true if the given process is being run under a debugger.
 //
@@ -25,20 +25,20 @@ BASE_EXPORT bool WaitForDebugger(int wait_seconds, bool silent);
 //
 // WARNING: Because of this, on OS X, a call MUST be made to this function
 // BEFORE the sandbox is enabled.
-BASE_EXPORT bool BeingDebugged();
+BUTIL_EXPORT bool BeingDebugged();
 
 // Break into the debugger, assumes a debugger is present.
-BASE_EXPORT void BreakDebugger();
+BUTIL_EXPORT void BreakDebugger();
 
 // Used in test code, this controls whether showing dialogs and breaking into
 // the debugger is suppressed for debug errors, even in debug mode (normally
 // release mode doesn't do this stuff --  this is controlled separately).
 // Normally UI is not suppressed.  This is normally used when running automated
 // tests where we want a crash rather than a dialog or a debugger.
-BASE_EXPORT void SetSuppressDebugUI(bool suppress);
-BASE_EXPORT bool IsDebugUISuppressed();
+BUTIL_EXPORT void SetSuppressDebugUI(bool suppress);
+BUTIL_EXPORT bool IsDebugUISuppressed();
 
 }  // namespace debug
 }  // namespace butil
 
-#endif  // BASE_DEBUG_DEBUGGER_H
+#endif  // BUTIL_DEBUG_DEBUGGER_H

+ 5 - 5
src/butil/debug/dump_without_crashing.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_DEBUG_DUMP_WITHOUT_CRASHING_H_
-#define BASE_DEBUG_DUMP_WITHOUT_CRASHING_H_
+#ifndef BUTIL_DEBUG_DUMP_WITHOUT_CRASHING_H_
+#define BUTIL_DEBUG_DUMP_WITHOUT_CRASHING_H_
 
 #include "butil/base_export.h"
 #include "butil/compiler_specific.h"
@@ -14,14 +14,14 @@ namespace butil {
 namespace debug {
 
 // Handler to silently dump the current process without crashing.
-BASE_EXPORT void DumpWithoutCrashing();
+BUTIL_EXPORT void DumpWithoutCrashing();
 
 // Sets a function that'll be invoked to dump the current process when
 // DumpWithoutCrashing() is called.
-BASE_EXPORT void SetDumpWithoutCrashingFunction(void (CDECL *function)());
+BUTIL_EXPORT void SetDumpWithoutCrashingFunction(void (CDECL *function)());
 
 }  // namespace debug
 
 }  // namespace butil
 
-#endif  // BASE_DEBUG_DUMP_WITHOUT_CRASHING_H_
+#endif  // BUTIL_DEBUG_DUMP_WITHOUT_CRASHING_H_

+ 3 - 3
src/butil/debug/leak_annotations.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_DEBUG_LEAK_ANNOTATIONS_H_
-#define BASE_DEBUG_LEAK_ANNOTATIONS_H_
+#ifndef BUTIL_DEBUG_LEAK_ANNOTATIONS_H_
+#define BUTIL_DEBUG_LEAK_ANNOTATIONS_H_
 
 #include "butil/basictypes.h"
 #include "butil/build_config.h"
@@ -52,4 +52,4 @@ class ScopedLeakSanitizerDisabler {
 
 #endif
 
-#endif  // BASE_DEBUG_LEAK_ANNOTATIONS_H_
+#endif  // BUTIL_DEBUG_LEAK_ANNOTATIONS_H_

+ 3 - 3
src/butil/debug/leak_tracker.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_DEBUG_LEAK_TRACKER_H_
-#define BASE_DEBUG_LEAK_TRACKER_H_
+#ifndef BUTIL_DEBUG_LEAK_TRACKER_H_
+#define BUTIL_DEBUG_LEAK_TRACKER_H_
 
 #include "butil/build_config.h"
 
@@ -135,4 +135,4 @@ class LeakTracker : public LinkNode<LeakTracker<T> > {
 }  // namespace debug
 }  // namespace butil
 
-#endif  // BASE_DEBUG_LEAK_TRACKER_H_
+#endif  // BUTIL_DEBUG_LEAK_TRACKER_H_

+ 5 - 5
src/butil/debug/proc_maps_linux.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_DEBUG_PROC_MAPS_LINUX_H_
-#define BASE_DEBUG_PROC_MAPS_LINUX_H_
+#ifndef BUTIL_DEBUG_PROC_MAPS_LINUX_H_
+#define BUTIL_DEBUG_PROC_MAPS_LINUX_H_
 
 #include <string>
 #include <vector>
@@ -77,14 +77,14 @@ struct MappedMemoryRegion {
 // starting other threads.
 //
 // [1] http://kernelnewbies.org/Documents/SeqFileHowTo
-BASE_EXPORT bool ReadProcMaps(std::string* proc_maps);
+BUTIL_EXPORT bool ReadProcMaps(std::string* proc_maps);
 
 // Parses /proc/<pid>/maps input data and stores in |regions|. Returns true
 // and updates |regions| if and only if all of |input| was successfully parsed.
-BASE_EXPORT bool ParseProcMaps(const std::string& input,
+BUTIL_EXPORT bool ParseProcMaps(const std::string& input,
                                std::vector<MappedMemoryRegion>* regions);
 
 }  // namespace debug
 }  // namespace butil
 
-#endif  // BASE_DEBUG_PROC_MAPS_LINUX_H_
+#endif  // BUTIL_DEBUG_PROC_MAPS_LINUX_H_

+ 7 - 7
src/butil/debug/stack_trace.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_DEBUG_STACK_TRACE_H_
-#define BASE_DEBUG_STACK_TRACE_H_
+#ifndef BUTIL_DEBUG_STACK_TRACE_H_
+#define BUTIL_DEBUG_STACK_TRACE_H_
 
 #include <iosfwd>
 #include <string>
@@ -25,7 +25,7 @@ namespace debug {
 // Enables stack dump to console output on exception and signals.
 // When enabled, the process will quit immediately. This is meant to be used in
 // unit_tests only! This is not thread-safe: only call from main thread.
-BASE_EXPORT bool EnableInProcessStackDumping();
+BUTIL_EXPORT bool EnableInProcessStackDumping();
 
 // A different version of EnableInProcessStackDumping that also works for
 // sandboxed processes.  For more details take a look at the description
@@ -34,12 +34,12 @@ BASE_EXPORT bool EnableInProcessStackDumping();
 // contents. In DEBUG builds, this function also opens the object files that
 // are loaded in memory and caches their file descriptors (this cannot be
 // done in official builds because it has security implications).
-BASE_EXPORT bool EnableInProcessStackDumpingForSandbox();
+BUTIL_EXPORT bool EnableInProcessStackDumpingForSandbox();
 
 // A stacktrace can be helpful in debugging. For example, you can include a
 // stacktrace member in a object (probably around #ifndef NDEBUG) so that you
 // can later see where the given object was created from.
-class BASE_EXPORT StackTrace {
+class BUTIL_EXPORT StackTrace {
  public:
   // Creates a stacktrace from the current location.
   StackTrace();
@@ -97,7 +97,7 @@ namespace internal {
 // conversion was successful or NULL otherwise. It never writes more than "sz"
 // bytes. Output will be truncated as needed, and a NUL character is always
 // appended.
-BASE_EXPORT char *itoa_r(intptr_t i,
+BUTIL_EXPORT char *itoa_r(intptr_t i,
                          char *buf,
                          size_t sz,
                          int base,
@@ -109,4 +109,4 @@ BASE_EXPORT char *itoa_r(intptr_t i,
 }  // namespace debug
 }  // namespace butil
 
-#endif  // BASE_DEBUG_STACK_TRACE_H_
+#endif  // BUTIL_DEBUG_STACK_TRACE_H_

+ 1 - 1
src/butil/endpoint.h

@@ -191,7 +191,7 @@ inline std::ostream& operator<<(std::ostream& os, const EndPointStr& ep_str) {
 }  // namespace butil
 
 
-namespace BASE_HASH_NAMESPACE {
+namespace BUTIL_HASH_NAMESPACE {
 
 // Implement methods for hashing a pair of integers, so they can be used as
 // keys in STL containers.

+ 7 - 7
src/butil/environment.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_ENVIRONMENT_H_
-#define BASE_ENVIRONMENT_H_
+#ifndef BUTIL_ENVIRONMENT_H_
+#define BUTIL_ENVIRONMENT_H_
 
 #include <map>
 #include <string>
@@ -18,12 +18,12 @@ namespace butil {
 namespace env_vars {
 
 #if defined(OS_POSIX)
-BASE_EXPORT extern const char kHome[];
+BUTIL_EXPORT extern const char kHome[];
 #endif
 
 }  // namespace env_vars
 
-class BASE_EXPORT Environment {
+class BUTIL_EXPORT Environment {
  public:
   virtual ~Environment();
 
@@ -63,7 +63,7 @@ typedef std::map<NativeEnvironmentString, NativeEnvironmentString>
 // which is a concatenated list of null-terminated 16-bit strings. The end is
 // marked by a double-null terminator. The size of the returned string will
 // include the terminators.
-BASE_EXPORT string16 AlterEnvironment(const wchar_t* env,
+BUTIL_EXPORT string16 AlterEnvironment(const wchar_t* env,
                                       const EnvironmentMap& changes);
 
 #elif defined(OS_POSIX)
@@ -79,7 +79,7 @@ typedef std::map<NativeEnvironmentString, NativeEnvironmentString>
 // returned array will have appended to it the storage for the array itself so
 // there is only one pointer to manage, but this means that you can't copy the
 // array without keeping the original around.
-BASE_EXPORT scoped_ptr<char*[]> AlterEnvironment(
+BUTIL_EXPORT scoped_ptr<char*[]> AlterEnvironment(
     const char* const* env,
     const EnvironmentMap& changes);
 
@@ -87,4 +87,4 @@ BASE_EXPORT scoped_ptr<char*[]> AlterEnvironment(
 
 }  // namespace butil
 
-#endif  // BASE_ENVIRONMENT_H_
+#endif  // BUTIL_ENVIRONMENT_H_

+ 3 - 3
src/butil/file_descriptor_posix.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILE_DESCRIPTOR_POSIX_H_
-#define BASE_FILE_DESCRIPTOR_POSIX_H_
+#ifndef BUTIL_FILE_DESCRIPTOR_POSIX_H_
+#define BUTIL_FILE_DESCRIPTOR_POSIX_H_
 
 #include "butil/files/file.h"
 
@@ -47,4 +47,4 @@ struct FileDescriptor {
 
 }  // namespace butil
 
-#endif  // BASE_FILE_DESCRIPTOR_POSIX_H_
+#endif  // BUTIL_FILE_DESCRIPTOR_POSIX_H_

+ 62 - 62
src/butil/file_util.h

@@ -5,8 +5,8 @@
 // This file contains utility functions for dealing with the local
 // filesystem.
 
-#ifndef BASE_FILE_UTIL_H_
-#define BASE_FILE_UTIL_H_
+#ifndef BUTIL_FILE_UTIL_H_
+#define BUTIL_FILE_UTIL_H_
 
 #include "butil/build_config.h"
 
@@ -46,14 +46,14 @@ class Time;
 // Returns an absolute version of a relative path. Returns an empty path on
 // error. On POSIX, this function fails if the path does not exist. This
 // function can result in I/O so it can be slow.
-BASE_EXPORT FilePath MakeAbsoluteFilePath(const FilePath& input);
+BUTIL_EXPORT FilePath MakeAbsoluteFilePath(const FilePath& input);
 
 // Returns the total number of bytes used by all the files under |root_path|.
 // If the path does not exist the function returns 0.
 //
 // This function is implemented using the FileEnumerator class so it is not
 // particularly speedy in any platform.
-BASE_EXPORT int64_t ComputeDirectorySize(const FilePath& root_path);
+BUTIL_EXPORT int64_t ComputeDirectorySize(const FilePath& root_path);
 
 // Deletes the given path, whether it's a file or a directory.
 // If it's a directory, it's perfectly happy to delete all of the
@@ -67,7 +67,7 @@ BASE_EXPORT int64_t ComputeDirectorySize(const FilePath& root_path);
 //
 // WARNING: USING THIS WITH recursive==true IS EQUIVALENT
 //          TO "rm -rf", SO USE WITH CAUTION.
-BASE_EXPORT bool DeleteFile(const FilePath& path, bool recursive);
+BUTIL_EXPORT bool DeleteFile(const FilePath& path, bool recursive);
 
 #if defined(OS_WIN)
 // Schedules to delete the given path, whether it's a file or a directory, until
@@ -75,7 +75,7 @@ BASE_EXPORT bool DeleteFile(const FilePath& path, bool recursive);
 // Note:
 // 1) The file/directory to be deleted should exist in a temp folder.
 // 2) The directory to be deleted must be empty.
-BASE_EXPORT bool DeleteFileAfterReboot(const FilePath& path);
+BUTIL_EXPORT bool DeleteFileAfterReboot(const FilePath& path);
 #endif
 
 // Moves the given path, whether it's a file or a directory.
@@ -83,7 +83,7 @@ BASE_EXPORT bool DeleteFileAfterReboot(const FilePath& path);
 // on different volumes, this will attempt to copy and delete. Returns
 // true for success.
 // This function fails if either path contains traversal components ('..').
-BASE_EXPORT bool Move(const FilePath& from_path, const FilePath& to_path);
+BUTIL_EXPORT bool Move(const FilePath& from_path, const FilePath& to_path);
 
 // Renames file |from_path| to |to_path|. Both paths must be on the same
 // volume, or the function will fail. Destination file will be created
@@ -91,7 +91,7 @@ BASE_EXPORT bool Move(const FilePath& from_path, const FilePath& to_path);
 // temporary files. On Windows it preserves attributes of the target file.
 // Returns true on success, leaving *error unchanged.
 // Returns false on failure and sets *error appropriately, if it is non-NULL.
-BASE_EXPORT bool ReplaceFile(const FilePath& from_path,
+BUTIL_EXPORT bool ReplaceFile(const FilePath& from_path,
                              const FilePath& to_path,
                              File::Error* error);
 
@@ -100,7 +100,7 @@ BASE_EXPORT bool ReplaceFile(const FilePath& from_path,
 //
 // This function keeps the metadata on Windows. The read only bit on Windows is
 // not kept.
-BASE_EXPORT bool CopyFile(const FilePath& from_path, const FilePath& to_path);
+BUTIL_EXPORT bool CopyFile(const FilePath& from_path, const FilePath& to_path);
 
 // Copies the given path, and optionally all subdirectories and their contents
 // as well.
@@ -112,28 +112,28 @@ BASE_EXPORT bool CopyFile(const FilePath& from_path, const FilePath& to_path);
 // applies.
 //
 // If you only need to copy a file use CopyFile, it's faster.
-BASE_EXPORT bool CopyDirectory(const FilePath& from_path,
+BUTIL_EXPORT bool CopyDirectory(const FilePath& from_path,
                                const FilePath& to_path,
                                bool recursive);
 
 // Returns true if the given path exists on the local filesystem,
 // false otherwise.
-BASE_EXPORT bool PathExists(const FilePath& path);
+BUTIL_EXPORT bool PathExists(const FilePath& path);
 
 // Returns true if the given path is writable by the user, false otherwise.
-BASE_EXPORT bool PathIsWritable(const FilePath& path);
+BUTIL_EXPORT bool PathIsWritable(const FilePath& path);
 
 // Returns true if the given path exists and is a directory, false otherwise.
-BASE_EXPORT bool DirectoryExists(const FilePath& path);
+BUTIL_EXPORT bool DirectoryExists(const FilePath& path);
 
 // Returns true if the contents of the two files given are equal, false
 // otherwise.  If either file can't be read, returns false.
-BASE_EXPORT bool ContentsEqual(const FilePath& filename1,
+BUTIL_EXPORT bool ContentsEqual(const FilePath& filename1,
                                const FilePath& filename2);
 
 // Returns true if the contents of the two text files given are equal, false
 // otherwise.  This routine treats "\r\n" and "\n" as equivalent.
-BASE_EXPORT bool TextContentsEqual(const FilePath& filename1,
+BUTIL_EXPORT bool TextContentsEqual(const FilePath& filename1,
                                    const FilePath& filename2);
 
 // Reads the file at |path| into |contents| and returns true on success and
@@ -143,7 +143,7 @@ BASE_EXPORT bool TextContentsEqual(const FilePath& filename1,
 // file before the error occurred.
 // |contents| may be NULL, in which case this function is useful for its side
 // effect of priming the disk cache (could be used for unit tests).
-BASE_EXPORT bool ReadFileToString(const FilePath& path, std::string* contents);
+BUTIL_EXPORT bool ReadFileToString(const FilePath& path, std::string* contents);
 
 // Reads the file at |path| into |contents| and returns true on success and
 // false on error.  For security reasons, a |path| containing path traversal
@@ -154,7 +154,7 @@ BASE_EXPORT bool ReadFileToString(const FilePath& path, std::string* contents);
 // |max_size|.
 // |contents| may be NULL, in which case this function is useful for its side
 // effect of priming the disk cache (could be used for unit tests).
-BASE_EXPORT bool ReadFileToString(const FilePath& path,
+BUTIL_EXPORT bool ReadFileToString(const FilePath& path,
                                   std::string* contents,
                                   size_t max_size);
 
@@ -163,16 +163,16 @@ BASE_EXPORT bool ReadFileToString(const FilePath& path,
 // Read exactly |bytes| bytes from file descriptor |fd|, storing the result
 // in |buffer|. This function is protected against EINTR and partial reads.
 // Returns true iff |bytes| bytes have been successfully read from |fd|.
-BASE_EXPORT bool ReadFromFD(int fd, char* buffer, size_t bytes);
+BUTIL_EXPORT bool ReadFromFD(int fd, char* buffer, size_t bytes);
 
 // Creates a symbolic link at |symlink| pointing to |target|.  Returns
 // false on failure.
-BASE_EXPORT bool CreateSymbolicLink(const FilePath& target,
+BUTIL_EXPORT bool CreateSymbolicLink(const FilePath& target,
                                     const FilePath& symlink);
 
 // Reads the given |symlink| and returns where it points to in |target|.
 // Returns false upon failure.
-BASE_EXPORT bool ReadSymbolicLink(const FilePath& symlink, FilePath* target);
+BUTIL_EXPORT bool ReadSymbolicLink(const FilePath& symlink, FilePath* target);
 
 // Bits and masks of the file permission.
 enum FilePermissionBits {
@@ -195,15 +195,15 @@ enum FilePermissionBits {
 // Reads the permission of the given |path|, storing the file permission
 // bits in |mode|. If |path| is symbolic link, |mode| is the permission of
 // a file which the symlink points to.
-BASE_EXPORT bool GetPosixFilePermissions(const FilePath& path, int* mode);
+BUTIL_EXPORT bool GetPosixFilePermissions(const FilePath& path, int* mode);
 // Sets the permission of the given |path|. If |path| is symbolic link, sets
 // the permission of a file which the symlink points to.
-BASE_EXPORT bool SetPosixFilePermissions(const FilePath& path, int mode);
+BUTIL_EXPORT bool SetPosixFilePermissions(const FilePath& path, int mode);
 
 #endif  // OS_POSIX
 
 // Returns true if the given directory is empty
-BASE_EXPORT bool IsDirectoryEmpty(const FilePath& dir_path);
+BUTIL_EXPORT bool IsDirectoryEmpty(const FilePath& dir_path);
 
 // Get the temporary directory provided by the system.
 //
@@ -211,7 +211,7 @@ BASE_EXPORT bool IsDirectoryEmpty(const FilePath& dir_path);
 // instead of this function. Those variants will ensure that the proper
 // permissions are set so that other users on the system can't edit them while
 // they're open (which can lead to security issues).
-BASE_EXPORT bool GetTempDir(FilePath* path);
+BUTIL_EXPORT bool GetTempDir(FilePath* path);
 
 // Get the home directory. This is more complicated than just getenv("HOME")
 // as it knows to fall back on getpwent() etc.
@@ -219,37 +219,37 @@ BASE_EXPORT bool GetTempDir(FilePath* path);
 // You should not generally call this directly. Instead use DIR_HOME with the
 // path service which will use this function but cache the value.
 // Path service may also override DIR_HOME.
-BASE_EXPORT FilePath GetHomeDir();
+BUTIL_EXPORT FilePath GetHomeDir();
 
 // Creates a temporary file. The full path is placed in |path|, and the
 // function returns true if was successful in creating the file. The file will
 // be empty and all handles closed after this function returns.
-BASE_EXPORT bool CreateTemporaryFile(FilePath* path);
+BUTIL_EXPORT bool CreateTemporaryFile(FilePath* path);
 
 // Same as CreateTemporaryFile but the file is created in |dir|.
-BASE_EXPORT bool CreateTemporaryFileInDir(const FilePath& dir,
+BUTIL_EXPORT bool CreateTemporaryFileInDir(const FilePath& dir,
                                           FilePath* temp_file);
 
 // Create and open a temporary file.  File is opened for read/write.
 // The full path is placed in |path|.
 // Returns a handle to the opened file or NULL if an error occurred.
-BASE_EXPORT FILE* CreateAndOpenTemporaryFile(FilePath* path);
+BUTIL_EXPORT FILE* CreateAndOpenTemporaryFile(FilePath* path);
 
 // Similar to CreateAndOpenTemporaryFile, but the file is created in |dir|.
-BASE_EXPORT FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir,
+BUTIL_EXPORT FILE* CreateAndOpenTemporaryFileInDir(const FilePath& dir,
                                                   FilePath* path);
 
 // Create a new directory. If prefix is provided, the new directory name is in
 // the format of prefixyyyy.
 // NOTE: prefix is ignored in the POSIX implementation.
 // If success, return true and output the full path of the directory created.
-BASE_EXPORT bool CreateNewTempDirectory(const FilePath::StringType& prefix,
+BUTIL_EXPORT bool CreateNewTempDirectory(const FilePath::StringType& prefix,
                                         FilePath* new_temp_path);
 
 // Create a directory within another directory.
 // Extra characters will be appended to |prefix| to ensure that the
 // new directory does not have the same name as an existing directory.
-BASE_EXPORT bool CreateTemporaryDirInDir(const FilePath& base_dir,
+BUTIL_EXPORT bool CreateTemporaryDirInDir(const FilePath& base_dir,
                                          const FilePath::StringType& prefix,
                                          FilePath* new_dir);
 
@@ -260,19 +260,19 @@ BASE_EXPORT bool CreateTemporaryDirInDir(const FilePath& base_dir,
 // The directory is readable for all the users.
 // Returns true on success, leaving *error unchanged.
 // Returns false on failure and sets *error appropriately, if it is non-NULL.
-BASE_EXPORT bool CreateDirectoryAndGetError(const FilePath& full_path,
+BUTIL_EXPORT bool CreateDirectoryAndGetError(const FilePath& full_path,
                                             File::Error* error);
-BASE_EXPORT bool CreateDirectoryAndGetError(const FilePath& full_path,
+BUTIL_EXPORT bool CreateDirectoryAndGetError(const FilePath& full_path,
                                             File::Error* error,
                                             bool create_parents);
 
 // Backward-compatible convenience method for the above.
-BASE_EXPORT bool CreateDirectory(const FilePath& full_path);
-BASE_EXPORT bool CreateDirectory(const FilePath& full_path, bool create_parents);
+BUTIL_EXPORT bool CreateDirectory(const FilePath& full_path);
+BUTIL_EXPORT bool CreateDirectory(const FilePath& full_path, bool create_parents);
 
 
 // Returns the file size. Returns true on success.
-BASE_EXPORT bool GetFileSize(const FilePath& file_path, int64_t* file_size);
+BUTIL_EXPORT bool GetFileSize(const FilePath& file_path, int64_t* file_size);
 
 // Sets |real_path| to |path| with symbolic links and junctions expanded.
 // On windows, make sure the path starts with a lettered drive.
@@ -280,79 +280,79 @@ BASE_EXPORT bool GetFileSize(const FilePath& file_path, int64_t* file_size);
 // a directory or to a nonexistent path.  On windows, this function will
 // fail if |path| is a junction or symlink that points to an empty file,
 // or if |real_path| would be longer than MAX_PATH characters.
-BASE_EXPORT bool NormalizeFilePath(const FilePath& path, FilePath* real_path);
+BUTIL_EXPORT bool NormalizeFilePath(const FilePath& path, FilePath* real_path);
 
 #if defined(OS_WIN)
 
 // Given a path in NT native form ("\Device\HarddiskVolumeXX\..."),
 // return in |drive_letter_path| the equivalent path that starts with
 // a drive letter ("C:\...").  Return false if no such path exists.
-BASE_EXPORT bool DevicePathToDriveLetterPath(const FilePath& device_path,
+BUTIL_EXPORT bool DevicePathToDriveLetterPath(const FilePath& device_path,
                                              FilePath* drive_letter_path);
 
 // Given an existing file in |path|, set |real_path| to the path
 // in native NT format, of the form "\Device\HarddiskVolumeXX\..".
 // Returns false if the path can not be found. Empty files cannot
 // be resolved with this function.
-BASE_EXPORT bool NormalizeToNativeFilePath(const FilePath& path,
+BUTIL_EXPORT bool NormalizeToNativeFilePath(const FilePath& path,
                                            FilePath* nt_path);
 #endif
 
 // This function will return if the given file is a symlink or not.
-BASE_EXPORT bool IsLink(const FilePath& file_path);
+BUTIL_EXPORT bool IsLink(const FilePath& file_path);
 
 // Returns information about the given file path.
-BASE_EXPORT bool GetFileInfo(const FilePath& file_path, File::Info* info);
+BUTIL_EXPORT bool GetFileInfo(const FilePath& file_path, File::Info* info);
 
 // Sets the time of the last access and the time of the last modification.
-BASE_EXPORT bool TouchFile(const FilePath& path,
+BUTIL_EXPORT bool TouchFile(const FilePath& path,
                            const Time& last_accessed,
                            const Time& last_modified);
 
 // Wrapper for fopen-like calls. Returns non-NULL FILE* on success.
-BASE_EXPORT FILE* OpenFile(const FilePath& filename, const char* mode);
+BUTIL_EXPORT FILE* OpenFile(const FilePath& filename, const char* mode);
 
 // Closes file opened by OpenFile. Returns true on success.
-BASE_EXPORT bool CloseFile(FILE* file);
+BUTIL_EXPORT bool CloseFile(FILE* file);
 
 // Associates a standard FILE stream with an existing File. Note that this
 // functions take ownership of the existing File.
-BASE_EXPORT FILE* FileToFILE(File file, const char* mode);
+BUTIL_EXPORT FILE* FileToFILE(File file, const char* mode);
 
 // Truncates an open file to end at the location of the current file pointer.
 // This is a cross-platform analog to Windows' SetEndOfFile() function.
-BASE_EXPORT bool TruncateFile(FILE* file);
+BUTIL_EXPORT bool TruncateFile(FILE* file);
 
 // Reads at most the given number of bytes from the file into the buffer.
 // Returns the number of read bytes, or -1 on error.
-BASE_EXPORT int ReadFile(const FilePath& filename, char* data, int max_size);
+BUTIL_EXPORT int ReadFile(const FilePath& filename, char* data, int max_size);
 
 // Writes the given buffer into the file, overwriting any data that was
 // previously there.  Returns the number of bytes written, or -1 on error.
-BASE_EXPORT int WriteFile(const FilePath& filename, const char* data,
+BUTIL_EXPORT int WriteFile(const FilePath& filename, const char* data,
                           int size);
 
 #if defined(OS_POSIX)
 // Append the data to |fd|. Does not close |fd| when done.
-BASE_EXPORT int WriteFileDescriptor(const int fd, const char* data, int size);
+BUTIL_EXPORT int WriteFileDescriptor(const int fd, const char* data, int size);
 #endif
 
 // Append the given buffer into the file. Returns the number of bytes written,
 // or -1 on error.
-BASE_EXPORT int AppendToFile(const FilePath& filename,
+BUTIL_EXPORT int AppendToFile(const FilePath& filename,
                              const char* data, int size);
 
 // Gets the current working directory for the process.
-BASE_EXPORT bool GetCurrentDirectory(FilePath* path);
+BUTIL_EXPORT bool GetCurrentDirectory(FilePath* path);
 
 // Sets the current working directory for the process.
-BASE_EXPORT bool SetCurrentDirectory(const FilePath& path);
+BUTIL_EXPORT bool SetCurrentDirectory(const FilePath& path);
 
 // Attempts to find a number that can be appended to the |path| to make it
 // unique. If |path| does not exist, 0 is returned.  If it fails to find such
 // a number, -1 is returned. If |suffix| is not empty, also checks the
 // existence of it with the given suffix.
-BASE_EXPORT int GetUniquePathNumber(const FilePath& path,
+BUTIL_EXPORT int GetUniquePathNumber(const FilePath& path,
                                     const FilePath::StringType& suffix);
 
 #if defined(OS_POSIX)
@@ -367,7 +367,7 @@ BASE_EXPORT int GetUniquePathNumber(const FilePath& path,
 // * Are not symbolic links.
 // This is useful for checking that a config file is administrator-controlled.
 // |base| must contain |path|.
-BASE_EXPORT bool VerifyPathControlledByUser(const butil::FilePath& base,
+BUTIL_EXPORT bool VerifyPathControlledByUser(const butil::FilePath& base,
                                             const butil::FilePath& path,
                                             uid_t owner_uid,
                                             const std::set<gid_t>& group_gids);
@@ -381,12 +381,12 @@ BASE_EXPORT bool VerifyPathControlledByUser(const butil::FilePath& base,
 // the filesystem, are owned by the superuser, controlled by the group
 // "admin", are not writable by all users, and contain no symbolic links.
 // Will return false if |path| does not exist.
-BASE_EXPORT bool VerifyPathControlledByAdmin(const butil::FilePath& path);
+BUTIL_EXPORT bool VerifyPathControlledByAdmin(const butil::FilePath& path);
 #endif  // defined(OS_MACOSX) && !defined(OS_IOS)
 
 // Returns the maximum length of path component on the volume containing
 // the directory |path|, in the number of FilePath::CharType, or -1 on failure.
-BASE_EXPORT int GetMaximumPathComponentLength(const butil::FilePath& path);
+BUTIL_EXPORT int GetMaximumPathComponentLength(const butil::FilePath& path);
 
 #if defined(OS_LINUX)
 // Broad categories of file systems as returned by statfs() on Linux.
@@ -405,7 +405,7 @@ enum FileSystemType {
 
 // Attempts determine the FileSystemType for |path|.
 // Returns false if |path| doesn't exist.
-BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type);
+BUTIL_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type);
 #endif
 
 #if defined(OS_POSIX)
@@ -414,7 +414,7 @@ BASE_EXPORT bool GetFileSystemType(const FilePath& path, FileSystemType* type);
 // depends on how /dev/shmem was mounted. As a result, you must supply whether
 // you intend to create executable shmem segments so this function can find
 // an appropriate location.
-BASE_EXPORT bool GetShmemTempDir(bool executable, FilePath* path);
+BUTIL_EXPORT bool GetShmemTempDir(bool executable, FilePath* path);
 #endif
 
 }  // namespace butil
@@ -443,12 +443,12 @@ namespace internal {
 
 // Same as Move but allows paths with traversal components.
 // Use only with extreme care.
-BASE_EXPORT bool MoveUnsafe(const FilePath& from_path,
+BUTIL_EXPORT bool MoveUnsafe(const FilePath& from_path,
                             const FilePath& to_path);
 
 // Same as CopyFile but allows paths with traversal components.
 // Use only with extreme care.
-BASE_EXPORT bool CopyFileUnsafe(const FilePath& from_path,
+BUTIL_EXPORT bool CopyFileUnsafe(const FilePath& from_path,
                                 const FilePath& to_path);
 
 #if defined(OS_WIN)
@@ -456,11 +456,11 @@ BASE_EXPORT bool CopyFileUnsafe(const FilePath& from_path,
 // Returns true if all operations succeed.
 // This function simulates Move(), but unlike Move() it works across volumes.
 // This function is not transactional.
-BASE_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path,
+BUTIL_EXPORT bool CopyAndDeleteDirectory(const FilePath& from_path,
                                         const FilePath& to_path);
 #endif  // defined(OS_WIN)
 
 }  // namespace internal
 }  // namespace butil
 
-#endif  // BASE_FILE_UTIL_H_
+#endif  // BUTIL_FILE_UTIL_H_

+ 3 - 3
src/butil/files/dir_reader_fallback.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_DIR_READER_FALLBACK_H_
-#define BASE_FILES_DIR_READER_FALLBACK_H_
+#ifndef BUTIL_FILES_DIR_READER_FALLBACK_H_
+#define BUTIL_FILES_DIR_READER_FALLBACK_H_
 
 namespace butil {
 
@@ -32,4 +32,4 @@ class DirReaderFallback {
 
 }  // namespace butil
 
-#endif  // BASE_FILES_DIR_READER_FALLBACK_H_
+#endif  // BUTIL_FILES_DIR_READER_FALLBACK_H_

+ 3 - 3
src/butil/files/dir_reader_linux.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_DIR_READER_LINUX_H_
-#define BASE_FILES_DIR_READER_LINUX_H_
+#ifndef BUTIL_FILES_DIR_READER_LINUX_H_
+#define BUTIL_FILES_DIR_READER_LINUX_H_
 
 #include <errno.h>
 #include <fcntl.h>
@@ -95,4 +95,4 @@ class DirReaderLinux {
 
 }  // namespace butil
 
-#endif // BASE_FILES_DIR_READER_LINUX_H_
+#endif // BUTIL_FILES_DIR_READER_LINUX_H_

+ 3 - 3
src/butil/files/dir_reader_posix.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_DIR_READER_POSIX_H_
-#define BASE_FILES_DIR_READER_POSIX_H_
+#ifndef BUTIL_FILES_DIR_READER_POSIX_H_
+#define BUTIL_FILES_DIR_READER_POSIX_H_
 
 #include "butil/build_config.h"
 
@@ -33,4 +33,4 @@ typedef DirReaderFallback DirReaderPosix;
 
 }  // namespace butil
 
-#endif // BASE_FILES_DIR_READER_POSIX_H_
+#endif // BUTIL_FILES_DIR_READER_POSIX_H_

+ 3 - 3
src/butil/files/fd_guard.h

@@ -16,8 +16,8 @@
 // Author: Ge,Jun (gejun@baidu.com)
 // Date: Mon. Nov 7 14:47:36 CST 2011
 
-#ifndef BASE_FD_GUARD_H
-#define BASE_FD_GUARD_H
+#ifndef BUTIL_FD_GUARD_H
+#define BUTIL_FD_GUARD_H
 
 #include "butil/files/scoped_file.h"
 
@@ -30,4 +30,4 @@ public:
 }  // files
 }  // base
 
-#endif  // BASE_FD_GUARD_H
+#endif  // BUTIL_FD_GUARD_H

+ 5 - 5
src/butil/files/file.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_FILE_H_
-#define BASE_FILES_FILE_H_
+#ifndef BUTIL_FILES_FILE_H_
+#define BUTIL_FILES_FILE_H_
 
 #include "butil/build_config.h"
 #if defined(OS_WIN)
@@ -52,7 +52,7 @@ typedef struct stat64 stat_wrapper_t;
 // obvious non-modifying way are marked as const. Any method that forward calls
 // to the OS is not considered const, even if there is no apparent change to
 // member variables.
-class BASE_EXPORT File {
+class BUTIL_EXPORT File {
   MOVE_ONLY_TYPE_FOR_CPP_03(File, RValue)
 
  public:
@@ -128,7 +128,7 @@ class BASE_EXPORT File {
   // make sure to update all functions that use it in file_util_{win|posix}.cc
   // too, and the ParamTraits<butil::PlatformFileInfo> implementation in
   // chrome/common/common_param_traits.cc.
-  struct BASE_EXPORT Info {
+  struct BUTIL_EXPORT Info {
     Info();
     ~Info();
 #if defined(OS_POSIX)
@@ -310,4 +310,4 @@ class BASE_EXPORT File {
 
 }  // namespace butil
 
-#endif  // BASE_FILES_FILE_H_
+#endif  // BUTIL_FILES_FILE_H_

+ 5 - 5
src/butil/files/file_enumerator.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_FILE_ENUMERATOR_H_
-#define BASE_FILES_FILE_ENUMERATOR_H_
+#ifndef BUTIL_FILES_FILE_ENUMERATOR_H_
+#define BUTIL_FILES_FILE_ENUMERATOR_H_
 
 #include <stack>
 #include <vector>
@@ -34,10 +34,10 @@ namespace butil {
 //                             FILE_PATH_LITERAL("*.txt"));
 //   for (butil::FilePath name = enum.Next(); !name.empty(); name = enum.Next())
 //     ...
-class BASE_EXPORT FileEnumerator {
+class BUTIL_EXPORT FileEnumerator {
  public:
   // Note: copy & assign supported.
-  class BASE_EXPORT FileInfo {
+  class BUTIL_EXPORT FileInfo {
    public:
     FileInfo();
     ~FileInfo();
@@ -156,4 +156,4 @@ class BASE_EXPORT FileEnumerator {
 
 }  // namespace butil
 
-#endif  // BASE_FILES_FILE_ENUMERATOR_H_
+#endif  // BUTIL_FILES_FILE_ENUMERATOR_H_

+ 7 - 7
src/butil/files/file_path.h

@@ -99,8 +99,8 @@
 //    paths (sometimes)?", available at:
 //    http://blogs.msdn.com/oldnewthing/archive/2005/11/22/495740.aspx
 
-#ifndef BASE_FILES_FILE_PATH_H_
-#define BASE_FILES_FILE_PATH_H_
+#ifndef BUTIL_FILES_FILE_PATH_H_
+#define BUTIL_FILES_FILE_PATH_H_
 
 #include <stddef.h>
 #include <string>
@@ -126,7 +126,7 @@ namespace butil {
 
 // An abstraction to isolate users from the differences between native
 // pathnames on different platforms.
-class BASE_EXPORT FilePath {
+class BUTIL_EXPORT FilePath {
  public:
 #if defined(OS_POSIX)
   // On most platforms, native pathnames are char arrays, and the encoding
@@ -430,7 +430,7 @@ class BASE_EXPORT FilePath {
 }  // namespace butil
 
 // This is required by googletest to print a readable output on test failures.
-BASE_EXPORT extern void PrintTo(const butil::FilePath& path, std::ostream* out);
+BUTIL_EXPORT extern void PrintTo(const butil::FilePath& path, std::ostream* out);
 
 // Macros for string literal initialization of FilePath::CharType[], and for
 // using a FilePath::CharType[] in a printf-style format string.
@@ -446,7 +446,7 @@ BASE_EXPORT extern void PrintTo(const butil::FilePath& path, std::ostream* out);
 
 // Provide a hash function so that hash_sets and maps can contain FilePath
 // objects.
-namespace BASE_HASH_NAMESPACE {
+namespace BUTIL_HASH_NAMESPACE {
 #if defined(COMPILER_GCC)
 
 template<>
@@ -464,6 +464,6 @@ inline size_t hash_value(const butil::FilePath& f) {
 
 #endif  // COMPILER
 
-}  // namespace BASE_HASH_NAMESPACE
+}  // namespace BUTIL_HASH_NAMESPACE
 
-#endif  // BASE_FILES_FILE_PATH_H_
+#endif  // BUTIL_FILES_FILE_PATH_H_

+ 4 - 4
src/butil/files/file_path_watcher.h

@@ -4,8 +4,8 @@
 
 // This module provides a way to monitor a file or directory for changes.
 
-#ifndef BASE_FILES_FILE_PATH_WATCHER_H_
-#define BASE_FILES_FILE_PATH_WATCHER_H_
+#ifndef BUTIL_FILES_FILE_PATH_WATCHER_H_
+#define BUTIL_FILES_FILE_PATH_WATCHER_H_
 
 #include "butil/base_export.h"
 #include "butil/basictypes.h"
@@ -25,7 +25,7 @@ namespace butil {
 // detect the creation and deletion of files in a watched directory, but will
 // not detect modifications to those files. See file_path_watcher_kqueue.cc for
 // details.
-class BASE_EXPORT FilePathWatcher {
+class BUTIL_EXPORT FilePathWatcher {
  public:
   // Callback type for Watch(). |path| points to the file that was updated,
   // and |error| is true if the platform specific code detected an error. In
@@ -108,4 +108,4 @@ class BASE_EXPORT FilePathWatcher {
 
 }  // namespace butil
 
-#endif  // BASE_FILES_FILE_PATH_WATCHER_H_
+#endif  // BUTIL_FILES_FILE_PATH_WATCHER_H_

+ 3 - 3
src/butil/files/file_path_watcher_fsevents.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_FILE_PATH_WATCHER_FSEVENTS_H_
-#define BASE_FILES_FILE_PATH_WATCHER_FSEVENTS_H_
+#ifndef BUTIL_FILES_FILE_PATH_WATCHER_FSEVENTS_H_
+#define BUTIL_FILES_FILE_PATH_WATCHER_FSEVENTS_H_
 
 #include <CoreServices/CoreServices.h>
 
@@ -70,4 +70,4 @@ class FilePathWatcherFSEvents : public FilePathWatcher::PlatformDelegate {
 
 }  // namespace butil
 
-#endif  // BASE_FILES_FILE_PATH_WATCHER_FSEVENTS_H_
+#endif  // BUTIL_FILES_FILE_PATH_WATCHER_FSEVENTS_H_

+ 3 - 3
src/butil/files/file_path_watcher_kqueue.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_
-#define BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_
+#ifndef BUTIL_FILES_FILE_PATH_WATCHER_KQUEUE_H_
+#define BUTIL_FILES_FILE_PATH_WATCHER_KQUEUE_H_
 
 #include <sys/event.h>
 #include <vector>
@@ -129,4 +129,4 @@ class FilePathWatcherKQueue : public FilePathWatcher::PlatformDelegate,
 
 }  // namespace butil
 
-#endif  // BASE_FILES_FILE_PATH_WATCHER_KQUEUE_H_
+#endif  // BUTIL_FILES_FILE_PATH_WATCHER_KQUEUE_H_

+ 3 - 3
src/butil/files/file_watcher.h

@@ -17,8 +17,8 @@
 
 // Watch timestamp of a file
 
-#ifndef BASE_FILES_FILE_WATCHER_H
-#define BASE_FILES_FILE_WATCHER_H
+#ifndef BUTIL_FILES_FILE_WATCHER_H
+#define BUTIL_FILES_FILE_WATCHER_H
 
 #include <stdint.h>                                 // int64_t
 #include <string>                                   // std::string
@@ -79,4 +79,4 @@ private:
 };
 }  // namespace butil
 
-#endif  // BASE_FILES_FILE_WATCHER_H
+#endif  // BUTIL_FILES_FILE_WATCHER_H

+ 4 - 4
src/butil/files/memory_mapped_file.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_MEMORY_MAPPED_FILE_H_
-#define BASE_FILES_MEMORY_MAPPED_FILE_H_
+#ifndef BUTIL_FILES_MEMORY_MAPPED_FILE_H_
+#define BUTIL_FILES_MEMORY_MAPPED_FILE_H_
 
 #include "butil/base_export.h"
 #include "butil/basictypes.h"
@@ -18,7 +18,7 @@ namespace butil {
 
 class FilePath;
 
-class BASE_EXPORT MemoryMappedFile {
+class BUTIL_EXPORT MemoryMappedFile {
  public:
   // The default constructor sets all members to invalid/null values.
   MemoryMappedFile();
@@ -69,4 +69,4 @@ class BASE_EXPORT MemoryMappedFile {
 
 }  // namespace butil
 
-#endif  // BASE_FILES_MEMORY_MAPPED_FILE_H_
+#endif  // BUTIL_FILES_MEMORY_MAPPED_FILE_H_

+ 4 - 4
src/butil/files/scoped_file.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_SCOPED_FILE_H_
-#define BASE_FILES_SCOPED_FILE_H_
+#ifndef BUTIL_FILES_SCOPED_FILE_H_
+#define BUTIL_FILES_SCOPED_FILE_H_
 
 #include <stdio.h>
 
@@ -18,7 +18,7 @@ namespace butil {
 namespace internal {
 
 #if defined(OS_POSIX)
-struct BASE_EXPORT ScopedFDCloseTraits {
+struct BUTIL_EXPORT ScopedFDCloseTraits {
   static int InvalidValue() {
     return -1;
   }
@@ -105,4 +105,4 @@ private:
 
 }  // namespace butil
 
-#endif  // BASE_FILES_SCOPED_FILE_H_
+#endif  // BUTIL_FILES_SCOPED_FILE_H_

+ 4 - 4
src/butil/files/scoped_temp_dir.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FILES_SCOPED_TEMP_DIR_H_
-#define BASE_FILES_SCOPED_TEMP_DIR_H_
+#ifndef BUTIL_FILES_SCOPED_TEMP_DIR_H_
+#define BUTIL_FILES_SCOPED_TEMP_DIR_H_
 
 // An object representing a temporary / scratch directory that should be cleaned
 // up (recursively) when this object goes out of scope.  Note that since
@@ -20,7 +20,7 @@
 
 namespace butil {
 
-class BASE_EXPORT ScopedTempDir {
+class BUTIL_EXPORT ScopedTempDir {
  public:
   // No directory is owned/created initially.
   ScopedTempDir();
@@ -59,4 +59,4 @@ class BASE_EXPORT ScopedTempDir {
 
 }  // namespace butil
 
-#endif  // BASE_FILES_SCOPED_TEMP_DIR_H_
+#endif  // BUTIL_FILES_SCOPED_TEMP_DIR_H_

+ 3 - 3
src/butil/files/temp_file.h

@@ -16,8 +16,8 @@
 //         Ge,Jun (gejun@baidu.com)
 // Date: Thu Oct 28 15:23:09 2010
 
-#ifndef BASE_FILES_TEMP_FILE_H
-#define BASE_FILES_TEMP_FILE_H
+#ifndef BUTIL_FILES_TEMP_FILE_H
+#define BUTIL_FILES_TEMP_FILE_H
 
 #include "butil/macros.h"
 
@@ -73,4 +73,4 @@ private:
 
 } // namespace butil
 
-#endif  // BASE_FILES_TEMP_FILE_H
+#endif  // BUTIL_FILES_TEMP_FILE_H

+ 3 - 3
src/butil/float_util.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FLOAT_UTIL_H_
-#define BASE_FLOAT_UTIL_H_
+#ifndef BUTIL_FLOAT_UTIL_H_
+#define BUTIL_FLOAT_UTIL_H_
 
 #include "butil/build_config.h"
 
@@ -33,4 +33,4 @@ inline bool IsNaN(const Float& number) {
 
 }  // namespace butil
 
-#endif  // BASE_FLOAT_UTIL_H_
+#endif  // BUTIL_FLOAT_UTIL_H_

+ 3 - 3
src/butil/format_macros.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_FORMAT_MACROS_H_
-#define BASE_FORMAT_MACROS_H_
+#ifndef BUTIL_FORMAT_MACROS_H_
+#define BUTIL_FORMAT_MACROS_H_
 
 // This file defines the format macros for some integer types.
 
@@ -98,4 +98,4 @@
 
 #endif
 
-#endif  // BASE_FORMAT_MACROS_H_
+#endif  // BUTIL_FORMAT_MACROS_H_

+ 3 - 3
src/butil/gtest_prod_util.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_GTEST_PROD_UTIL_H_
-#define BASE_GTEST_PROD_UTIL_H_
+#ifndef BUTIL_GTEST_PROD_UTIL_H_
+#define BUTIL_GTEST_PROD_UTIL_H_
 
 // [ Copied from gtest/gtest_prod.h ]
 // When you need to test the private or protected members of a class,
@@ -82,4 +82,4 @@ friend class test_case_name##_##test_name##_Test
   class test_case_name##_##DISABLED_##test_name##_Test; \
   class test_case_name##_##FLAKY_##test_name##_Test
 
-#endif  // BASE_GTEST_PROD_UTIL_H_
+#endif  // BUTIL_GTEST_PROD_UTIL_H_

+ 6 - 6
src/butil/guid.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_GUID_H_
-#define BASE_GUID_H_
+#ifndef BUTIL_GUID_H_
+#define BUTIL_GUID_H_
 
 #include <string>
 
@@ -17,16 +17,16 @@ namespace butil {
 // If GUID generation fails an empty string is returned.
 // The POSIX implementation uses psuedo random number generation to create
 // the GUID.  The Windows implementation uses system services.
-BASE_EXPORT std::string GenerateGUID();
+BUTIL_EXPORT std::string GenerateGUID();
 
 // Returns true if the input string conforms to the GUID format.
-BASE_EXPORT bool IsValidGUID(const std::string& guid);
+BUTIL_EXPORT bool IsValidGUID(const std::string& guid);
 
 #if defined(OS_POSIX)
 // For unit testing purposes only.  Do not use outside of tests.
-BASE_EXPORT std::string RandomDataToGUIDString(const uint64_t bytes[2]);
+BUTIL_EXPORT std::string RandomDataToGUIDString(const uint64_t bytes[2]);
 #endif
 
 }  // namespace butil
 
-#endif  // BASE_GUID_H_
+#endif  // BUTIL_GUID_H_

+ 4 - 4
src/butil/hash.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_HASH_H_
-#define BASE_HASH_H_
+#ifndef BUTIL_HASH_H_
+#define BUTIL_HASH_H_
 
 #include <limits>
 #include <string>
@@ -15,7 +15,7 @@
 namespace butil {
 
 // WARNING: This hash function should not be used for any cryptographic purpose.
-BASE_EXPORT uint32_t SuperFastHash(const char* data, int len);
+BUTIL_EXPORT uint32_t SuperFastHash(const char* data, int len);
 
 // Computes a hash of a memory buffer |data| of a given |length|.
 // WARNING: This hash function should not be used for any cryptographic purpose.
@@ -35,4 +35,4 @@ inline uint32_t Hash(const std::string& str) {
 
 }  // namespace butil
 
-#endif  // BASE_HASH_H_
+#endif  // BUTIL_HASH_H_

+ 6 - 6
src/butil/intrusive_ptr.hpp

@@ -95,7 +95,7 @@ public:
     }
 
 // Move support
-#if defined(BASE_CXX11_ENABLED)
+#if defined(BUTIL_CXX11_ENABLED)
     intrusive_ptr(intrusive_ptr && rhs) BAIDU_NOEXCEPT : px(rhs.px) {
         rhs.px = 0;
     }
@@ -147,7 +147,7 @@ public:
     }
 
     // implicit conversion to "bool"
-#if defined(BASE_CXX11_ENABLED)
+#if defined(BUTIL_CXX11_ENABLED)
     explicit operator bool () const BAIDU_NOEXCEPT {
         return px != 0;
     }
@@ -220,7 +220,7 @@ inline bool operator!=(const intrusive_ptr<T>& a, const intrusive_ptr<T>& b) {
 }
 #endif
 
-#if defined(BASE_CXX11_ENABLED)
+#if defined(BUTIL_CXX11_ENABLED)
 template<class T>
 inline bool operator==(const intrusive_ptr<T>& p, std::nullptr_t) BAIDU_NOEXCEPT {
     return p.get() == 0;
@@ -238,7 +238,7 @@ template<class T>
 inline bool operator!=(std::nullptr_t, const intrusive_ptr<T>& p) BAIDU_NOEXCEPT {
     return p.get() != 0;
 }
-#endif  // BASE_CXX11_ENABLED
+#endif  // BUTIL_CXX11_ENABLED
 
 template<class T>
 inline bool operator<(const intrusive_ptr<T>& a, const intrusive_ptr<T>& b) {
@@ -275,7 +275,7 @@ template<class Y> std::ostream & operator<< (std::ostream & os, const intrusive_
 } // namespace butil
 
 // hash_value
-namespace BASE_HASH_NAMESPACE {
+namespace BUTIL_HASH_NAMESPACE {
 
 #if defined(COMPILER_GCC)
 template<typename T>
@@ -291,6 +291,6 @@ inline size_t hash_value(const butil::intrusive_ptr<T>& sp) {
 }
 #endif  // COMPILER
 
-}  // namespace BASE_HASH_NAMESPACE
+}  // namespace BUTIL_HASH_NAMESPACE
 
 #endif  // BUTIL_INTRUSIVE_PTR_HPP

+ 4 - 4
src/butil/iobuf.cpp

@@ -206,9 +206,9 @@ void reset_blockmem_allocate_and_deallocate() {
     blockmem_deallocate = ::free;
 }
 
-butil::static_atomic<size_t> g_nblock = BASE_STATIC_ATOMIC_INIT(0);
-butil::static_atomic<size_t> g_blockmem = BASE_STATIC_ATOMIC_INIT(0);
-butil::static_atomic<size_t> g_newbigview = BASE_STATIC_ATOMIC_INIT(0);
+butil::static_atomic<size_t> g_nblock = BUTIL_STATIC_ATOMIC_INIT(0);
+butil::static_atomic<size_t> g_blockmem = BUTIL_STATIC_ATOMIC_INIT(0);
+butil::static_atomic<size_t> g_newbigview = BUTIL_STATIC_ATOMIC_INIT(0);
 
 }  // namespace iobuf
 
@@ -328,7 +328,7 @@ int get_tls_block_count() { return g_tls_data.num_blocks; }
 // Number of blocks that can't be returned to TLS which has too many block
 // already. This counter should be 0 in most scenarios, otherwise performance
 // of appending functions in IOPortal may be lowered.
-static butil::static_atomic<size_t> g_num_hit_tls_threshold = BASE_STATIC_ATOMIC_INIT(0);
+static butil::static_atomic<size_t> g_num_hit_tls_threshold = BUTIL_STATIC_ATOMIC_INIT(0);
 
 // Called in UT.
 void remove_tls_block_chain() {

+ 3 - 3
src/butil/iobuf.h

@@ -16,8 +16,8 @@
 // Author: Ge,Jun (gejun@baidu.com)
 // Date: Thu Nov 22 13:57:56 CST 2012
 
-#ifndef BASE_IOBUF_H
-#define BASE_IOBUF_H
+#ifndef BUTIL_IOBUF_H
+#define BUTIL_IOBUF_H
 
 #include <sys/uio.h>                             // iovec
 #include <stdint.h>                              // uint32_t
@@ -669,4 +669,4 @@ inline void swap(butil::IOBuf& a, butil::IOBuf& b) {
 
 #include "butil/iobuf_inl.h"
 
-#endif  // BASE_IOBUF_H
+#endif  // BUTIL_IOBUF_H

+ 3 - 3
src/butil/iobuf_inl.h

@@ -18,8 +18,8 @@
 
 // Inlined implementations of some methods defined in iobuf.h
 
-#ifndef BASE_IOBUF_INL_H
-#define BASE_IOBUF_INL_H
+#ifndef BUTIL_IOBUF_INL_H
+#define BUTIL_IOBUF_INL_H
 
 void* fast_memcpy(void *__restrict dest, const void *__restrict src, size_t n);
 
@@ -289,4 +289,4 @@ inline size_t IOBufBytesIterator::copy_and_forward(std::string* s, size_t n) {
 
 }  // namespace butil
 
-#endif  // BASE_IOBUF_INL_H
+#endif  // BUTIL_IOBUF_INL_H

+ 5 - 5
src/butil/lazy_instance.h

@@ -32,8 +32,8 @@
 //     ptr->DoDoDo();  // MyClass::DoDoDo
 //   }
 
-#ifndef BASE_LAZY_INSTANCE_H_
-#define BASE_LAZY_INSTANCE_H_
+#ifndef BUTIL_LAZY_INSTANCE_H_
+#define BUTIL_LAZY_INSTANCE_H_
 
 #include <new>  // For placement new.
 
@@ -126,11 +126,11 @@ static const subtle::AtomicWord kLazyInstanceStateCreating = 1;
 // Check if instance needs to be created. If so return true otherwise
 // if another thread has beat us, wait for instance to be created and
 // return false.
-BASE_EXPORT bool NeedsLazyInstance(subtle::AtomicWord* state);
+BUTIL_EXPORT bool NeedsLazyInstance(subtle::AtomicWord* state);
 
 // After creating an instance, call this to register the dtor to be called
 // at program exit and to update the atomic state to hold the |new_instance|
-BASE_EXPORT void CompleteLazyInstance(subtle::AtomicWord* state,
+BUTIL_EXPORT void CompleteLazyInstance(subtle::AtomicWord* state,
                                       subtle::AtomicWord new_instance,
                                       void* lazy_instance,
                                       void (*dtor)(void*));
@@ -229,4 +229,4 @@ class LazyInstance {
 
 }  // namespace butil
 
-#endif  // BASE_LAZY_INSTANCE_H_
+#endif  // BUTIL_LAZY_INSTANCE_H_

+ 3 - 3
src/butil/linux_magic.h

@@ -1,5 +1,5 @@
-#ifndef BASE_LINUX_MAGIC_H
-#define BASE_LINUX_MAGIC_H
+#ifndef BUTIL_LINUX_MAGIC_H
+#define BUTIL_LINUX_MAGIC_H
 
 #define ADFS_SUPER_MAGIC	0xadf5
 #define AFFS_SUPER_MAGIC	0xadff
@@ -59,4 +59,4 @@
 #define DEVPTS_SUPER_MAGIC	0x1cd1
 #define SOCKFS_MAGIC		0x534F434B
 
-#endif /* BASE_LINUX_MAGIC_H */
+#endif /* BUTIL_LINUX_MAGIC_H */

+ 1 - 1
src/butil/location.cc

@@ -89,7 +89,7 @@ LocationSnapshot::~LocationSnapshot() {
 #if defined(COMPILER_MSVC)
 __declspec(noinline)
 #endif
-BASE_EXPORT const void* GetProgramCounter() {
+BUTIL_EXPORT const void* GetProgramCounter() {
 #if defined(COMPILER_MSVC)
   return _ReturnAddress();
 #elif defined(COMPILER_GCC) && !defined(OS_NACL)

+ 6 - 6
src/butil/location.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_LOCATION_H_
-#define BASE_LOCATION_H_
+#ifndef BUTIL_LOCATION_H_
+#define BUTIL_LOCATION_H_
 
 #include <string>
 
@@ -14,7 +14,7 @@ namespace tracked_objects {
 
 // Location provides basic info where of an object was constructed, or was
 // significantly brought to life.
-class BASE_EXPORT Location {
+class BUTIL_EXPORT Location {
  public:
   // Constructor should be called with a long-lived char*, such as __FILE__.
   // It assumes the provided value will persist as a global constant, and it
@@ -67,7 +67,7 @@ class BASE_EXPORT Location {
 
 // A "snapshotted" representation of the Location class that can safely be
 // passed across process boundaries.
-struct BASE_EXPORT LocationSnapshot {
+struct BUTIL_EXPORT LocationSnapshot {
   // The default constructor is exposed to support the IPC serialization macros.
   LocationSnapshot();
   explicit LocationSnapshot(const tracked_objects::Location& location);
@@ -78,7 +78,7 @@ struct BASE_EXPORT LocationSnapshot {
   int line_number;
 };
 
-BASE_EXPORT const void* GetProgramCounter();
+BUTIL_EXPORT const void* GetProgramCounter();
 
 // Define a macro to record the current source location.
 #define FROM_HERE FROM_HERE_WITH_EXPLICIT_FUNCTION(__FUNCTION__)
@@ -91,4 +91,4 @@ BASE_EXPORT const void* GetProgramCounter();
 
 }  // namespace tracked_objects
 
-#endif  // BASE_LOCATION_H_
+#endif  // BUTIL_LOCATION_H_

+ 2 - 2
src/butil/logging.cc

@@ -961,7 +961,7 @@ void SetLastSystemErrorCode(SystemErrorCode err) {
 }
 
 #if defined(OS_WIN)
-BASE_EXPORT std::string SystemErrorCodeToString(SystemErrorCode error_code) {
+BUTIL_EXPORT std::string SystemErrorCodeToString(SystemErrorCode error_code) {
     const int error_message_buffer_size = 256;
     char msgbuf[error_message_buffer_size];
     DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS;
@@ -976,7 +976,7 @@ BASE_EXPORT std::string SystemErrorCodeToString(SystemErrorCode error_code) {
                               GetLastError(), error_code);
 }
 #elif defined(OS_POSIX)
-BASE_EXPORT std::string SystemErrorCodeToString(SystemErrorCode error_code) {
+BUTIL_EXPORT std::string SystemErrorCodeToString(SystemErrorCode error_code) {
     return berror(error_code);
 }
 #else

+ 25 - 25
src/butil/logging.h

@@ -17,8 +17,8 @@
 
 // Merged chromium log and streaming log.
 
-#ifndef BASE_LOGGING_H_
-#define BASE_LOGGING_H_
+#ifndef BUTIL_LOGGING_H_
+#define BUTIL_LOGGING_H_
 
 #include <butil/config.h>   // BRPC_WITH_GLOG
 
@@ -235,7 +235,7 @@ enum LogLockingState { LOCK_LOG_FILE, DONT_LOCK_LOG_FILE };
 // Defaults to APPEND_TO_OLD_LOG_FILE.
 enum OldFileDeletionState { DELETE_OLD_LOG_FILE, APPEND_TO_OLD_LOG_FILE };
 
-struct BASE_EXPORT LoggingSettings {
+struct BUTIL_EXPORT LoggingSettings {
     // The defaults values are:
     //
     //  logging_dest: LOG_DEFAULT
@@ -254,7 +254,7 @@ struct BASE_EXPORT LoggingSettings {
 };
 
 // Implementation of the InitLogging() method declared below. 
-BASE_EXPORT bool BaseInitLoggingImpl(const LoggingSettings& settings);
+BUTIL_EXPORT bool BaseInitLoggingImpl(const LoggingSettings& settings);
 
 // Sets the log file name and other global logging state. Calling this function
 // is recommended, and is normally done at the beginning of application init.
@@ -277,22 +277,22 @@ inline bool InitLogging(const LoggingSettings& settings) {
 // log file/displayed to the user (if applicable). Anything below this level
 // will be silently ignored. The log level defaults to 0 (everything is logged
 // up to level INFO) if this function is not called.
-BASE_EXPORT void SetMinLogLevel(int level);
+BUTIL_EXPORT void SetMinLogLevel(int level);
 
 // Gets the current log level.
-BASE_EXPORT int GetMinLogLevel();
+BUTIL_EXPORT int GetMinLogLevel();
 
 // Sets whether or not you'd like to see fatal debug messages popped up in
 // a dialog box or not.
 // Dialogs are not shown by default.
-BASE_EXPORT void SetShowErrorDialogs(bool enable_dialogs);
+BUTIL_EXPORT void SetShowErrorDialogs(bool enable_dialogs);
 
 // Sets the Log Assert Handler that will be used to notify of check failures.
 // The default handler shows a dialog box and then terminate the process,
 // however clients can use this function to override with their own handling
 // (e.g. a silent one for Unit Tests)
 typedef void (*LogAssertHandler)(const std::string& str);
-BASE_EXPORT void SetLogAssertHandler(LogAssertHandler handler);
+BUTIL_EXPORT void SetLogAssertHandler(LogAssertHandler handler);
 
 class LogSink {
 public:
@@ -311,7 +311,7 @@ private:
 // This function is thread-safe and waits until current LogSink is not used
 // anymore.
 // Returns previous sink.
-BASE_EXPORT LogSink* SetLogSink(LogSink* sink);
+BUTIL_EXPORT LogSink* SetLogSink(LogSink* sink);
 
 // The LogSink mainly for unit-testing. Logs will be appended to it.
 class StringSink : public LogSink, public std::string {
@@ -595,18 +595,18 @@ std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) {
 #if !defined(COMPILER_MSVC)
 // Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated
 // in logging.cc.
-extern template BASE_EXPORT std::string* MakeCheckOpString<int, int>(
+extern template BUTIL_EXPORT std::string* MakeCheckOpString<int, int>(
     const int&, const int&, const char* names);
-extern template BASE_EXPORT
+extern template BUTIL_EXPORT
 std::string* MakeCheckOpString<unsigned long, unsigned long>(
     const unsigned long&, const unsigned long&, const char* names);
-extern template BASE_EXPORT
+extern template BUTIL_EXPORT
 std::string* MakeCheckOpString<unsigned long, unsigned int>(
     const unsigned long&, const unsigned int&, const char* names);
-extern template BASE_EXPORT
+extern template BUTIL_EXPORT
 std::string* MakeCheckOpString<unsigned int, unsigned long>(
     const unsigned int&, const unsigned long&, const char* names);
-extern template BASE_EXPORT
+extern template BUTIL_EXPORT
 std::string* MakeCheckOpString<std::string, std::string>(
     const std::string&, const std::string&, const char* name);
 #endif
@@ -840,9 +840,9 @@ typedef int SystemErrorCode;
 
 // Alias for ::GetLastError() on Windows and errno on POSIX. Avoids having to
 // pull in windows.h just for GetLastError() and DWORD.
-BASE_EXPORT SystemErrorCode GetLastSystemErrorCode();
-BASE_EXPORT void SetLastSystemErrorCode(SystemErrorCode err);
-BASE_EXPORT std::string SystemErrorCodeToString(SystemErrorCode error_code);
+BUTIL_EXPORT SystemErrorCode GetLastSystemErrorCode();
+BUTIL_EXPORT void SetLastSystemErrorCode(SystemErrorCode err);
+BUTIL_EXPORT std::string SystemErrorCodeToString(SystemErrorCode error_code);
 
 // Underlying buffer to store logs. Comparing to using std::ostringstream
 // directly, this utility exposes more low-level methods so that we avoid
@@ -952,7 +952,7 @@ private:
 // You shouldn't actually use LogMessage's constructor to log things,
 // though.  You should use the LOG() macro (and variants thereof)
 // above.
-class BASE_EXPORT LogMessage {
+class BUTIL_EXPORT LogMessage {
 public:
     // Used for LOG(severity).
     LogMessage(const char* file, int line, LogSeverity severity);
@@ -995,7 +995,7 @@ public:
 
 #if defined(OS_WIN)
 // Appends a formatted system message of the GetLastError() type.
-class BASE_EXPORT Win32ErrorLogMessage {
+class BUTIL_EXPORT Win32ErrorLogMessage {
 public:
     Win32ErrorLogMessage(const char* file,
                          int line,
@@ -1015,7 +1015,7 @@ private:
 };
 #elif defined(OS_POSIX)
 // Appends a formatted system message of the errno type
-class BASE_EXPORT ErrnoLogMessage {
+class BUTIL_EXPORT ErrnoLogMessage {
 public:
     ErrnoLogMessage(const char* file,
                     int line,
@@ -1039,10 +1039,10 @@ private:
 // NOTE: Since the log file is opened as necessary by the action of logging
 //       statements, there's no guarantee that it will stay closed
 //       after this call.
-BASE_EXPORT void CloseLogFile();
+BUTIL_EXPORT void CloseLogFile();
 
 // Async signal safe logging mechanism.
-BASE_EXPORT void RawLog(int level, const char* message);
+BUTIL_EXPORT void RawLog(int level, const char* message);
 
 #define RAW_LOG(level, message)                         \
     ::logging::RawLog(::logging::BLOG_##level, message)
@@ -1055,7 +1055,7 @@ BASE_EXPORT void RawLog(int level, const char* message);
 
 #if defined(OS_WIN)
 // Returns the default log file path.
-BASE_EXPORT std::wstring GetLogFileFullPath();
+BUTIL_EXPORT std::wstring GetLogFileFullPath();
 #endif
 
 inline LogStream& noflush(LogStream& ls) {
@@ -1075,7 +1075,7 @@ using ::logging::print_vlog_sites;
 // which is normally ASCII. It is relatively slow, so try not to use it for
 // common cases. Non-ASCII characters will be converted to UTF-8 by these
 // operators.
-BASE_EXPORT std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
+BUTIL_EXPORT std::ostream& operator<<(std::ostream& out, const wchar_t* wstr);
 inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
     return out << wstr.c_str();
 }
@@ -1241,4 +1241,4 @@ inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) {
 enum { DEBUG_MODE = DCHECK_IS_ON() };
 
 
-#endif  // BASE_LOGGING_H_
+#endif  // BUTIL_LOGGING_H_

+ 15 - 15
src/butil/macros.h

@@ -7,8 +7,8 @@
 // that are closely related to things that are commonly used that belong in this
 // file.)
 
-#ifndef BASE_MACROS_H_
-#define BASE_MACROS_H_
+#ifndef BUTIL_MACROS_H_
+#define BUTIL_MACROS_H_
 
 #include <stddef.h>  // For size_t.
 #include <string.h>  // For memcpy.
@@ -23,25 +23,25 @@
 #undef DISALLOW_EVIL_CONSTRUCTORS
 #undef DISALLOW_IMPLICIT_CONSTRUCTORS
 
-#if !defined(BASE_CXX11_ENABLED)
-#define BASE_DELETE_FUNCTION(decl) decl
+#if !defined(BUTIL_CXX11_ENABLED)
+#define BUTIL_DELETE_FUNCTION(decl) decl
 #else
-#define BASE_DELETE_FUNCTION(decl) decl = delete
+#define BUTIL_DELETE_FUNCTION(decl) decl = delete
 #endif
 
 // Put this in the private: declarations for a class to be uncopyable.
 #define DISALLOW_COPY(TypeName)                         \
-    BASE_DELETE_FUNCTION(TypeName(const TypeName&))
+    BUTIL_DELETE_FUNCTION(TypeName(const TypeName&))
 
 // Put this in the private: declarations for a class to be unassignable.
 #define DISALLOW_ASSIGN(TypeName)                               \
-    BASE_DELETE_FUNCTION(void operator=(const TypeName&))
+    BUTIL_DELETE_FUNCTION(void operator=(const TypeName&))
 
 // A macro to disallow the copy constructor and operator= functions
 // This should be used in the private: declarations for a class
 #define DISALLOW_COPY_AND_ASSIGN(TypeName)                      \
-    BASE_DELETE_FUNCTION(TypeName(const TypeName&));            \
-    BASE_DELETE_FUNCTION(void operator=(const TypeName&))
+    BUTIL_DELETE_FUNCTION(TypeName(const TypeName&));            \
+    BUTIL_DELETE_FUNCTION(void operator=(const TypeName&))
 
 // An older, deprecated, politically incorrect name for the above.
 // NOTE: The usage of this macro was banned from our code base, but some
@@ -57,7 +57,7 @@
 // that wants to prevent anyone from instantiating it. This is
 // especially useful for classes containing only static methods.
 #define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
-    BASE_DELETE_FUNCTION(TypeName());            \
+    BUTIL_DELETE_FUNCTION(TypeName());            \
     DISALLOW_COPY_AND_ASSIGN(TypeName)
 
 // Concatenate numbers in c/c++ macros.
@@ -167,7 +167,7 @@ inline To implicit_cast(From const &f) {
 }
 }
 
-#if defined(BASE_CXX11_ENABLED)
+#if defined(BUTIL_CXX11_ENABLED)
 
 // C++11 supports compile-time assertion directly
 #define BAIDU_CASSERT(expr, msg) static_assert(expr, #msg)
@@ -211,7 +211,7 @@ template <> struct CAssert<false> { static const char * x; };
     enum { BAIDU_CONCAT(BAIDU_CONCAT(LINE_, __LINE__), __##msg) \
            = ::butil::CAssert<!!(expr)>::x };
 
-#endif  // BASE_CXX11_ENABLED
+#endif  // BUTIL_CXX11_ENABLED
 
 // The impl. of chrome does not work for offsetof(Object, private_filed)
 #undef COMPILE_ASSERT
@@ -327,7 +327,7 @@ enum LinkerInitialized { LINKER_INITIALIZED };
 #endif
 
 #ifndef BAIDU_TYPEOF
-# if defined(BASE_CXX11_ENABLED)
+# if defined(BUTIL_CXX11_ENABLED)
 #  define BAIDU_TYPEOF decltype
 # else
 #  ifdef _MSC_VER
@@ -336,7 +336,7 @@ enum LinkerInitialized { LINKER_INITIALIZED };
 #  else
 #   define BAIDU_TYPEOF typeof
 #  endif
-# endif // BASE_CXX11_ENABLED
+# endif // BUTIL_CXX11_ENABLED
 #endif  // BAIDU_TYPEOF
 
 // ptr:     the pointer to the member.
@@ -442,4 +442,4 @@ namespace {  /*anonymous namespace */                           \
 
 #endif  // __cplusplus
 
-#endif  // BASE_MACROS_H_
+#endif  // BUTIL_MACROS_H_

+ 10 - 10
src/butil/md5.h

@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef BASE_MD5_H_
-#define BASE_MD5_H_
+#ifndef BUTIL_MD5_H_
+#define BUTIL_MD5_H_
 
 #include "butil/base_export.h"
 #include "butil/strings/string_piece.h"
@@ -44,32 +44,32 @@ typedef char MD5Context[88];
 
 // Computes the MD5 sum of the given data buffer with the given length.
 // The given 'digest' structure will be filled with the result data.
-BASE_EXPORT void MD5Sum(const void* data, size_t length, MD5Digest* digest);
+BUTIL_EXPORT void MD5Sum(const void* data, size_t length, MD5Digest* digest);
 
 // Initializes the given MD5 context structure for subsequent calls to
 // MD5Update().
-BASE_EXPORT void MD5Init(MD5Context* context);
+BUTIL_EXPORT void MD5Init(MD5Context* context);
 
 // For the given buffer of |data| as a StringPiece, updates the given MD5
 // context with the sum of the data. You can call this any number of times
 // during the computation, except that MD5Init() must have been called first.
-BASE_EXPORT void MD5Update(MD5Context* context, const StringPiece& data);
+BUTIL_EXPORT void MD5Update(MD5Context* context, const StringPiece& data);
 
 // Finalizes the MD5 operation and fills the buffer with the digest.
-BASE_EXPORT void MD5Final(MD5Digest* digest, MD5Context* context);
+BUTIL_EXPORT void MD5Final(MD5Digest* digest, MD5Context* context);
 
 // MD5IntermediateFinal() generates a digest without finalizing the MD5
 // operation.  Can be used to generate digests for the input seen thus far,
 // without affecting the digest generated for the entire input.
-BASE_EXPORT void MD5IntermediateFinal(MD5Digest* digest,
+BUTIL_EXPORT void MD5IntermediateFinal(MD5Digest* digest,
                                       const MD5Context* context);
 
 // Converts a digest into human-readable hexadecimal.
-BASE_EXPORT std::string MD5DigestToBase16(const MD5Digest& digest);
+BUTIL_EXPORT std::string MD5DigestToBase16(const MD5Digest& digest);
 
 // Returns the MD5 (in hexadecimal) of a string.
-BASE_EXPORT std::string MD5String(const StringPiece& str);
+BUTIL_EXPORT std::string MD5String(const StringPiece& str);
 
 }  // namespace butil
 
-#endif  // BASE_MD5_H_
+#endif  // BUTIL_MD5_H_

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно