Skip to content

Commit

Permalink
Unify inclusion guards
Browse files Browse the repository at this point in the history
  • Loading branch information
gejun committed Nov 3, 2017
1 parent 09cc273 commit ef4eddd
Show file tree
Hide file tree
Showing 62 changed files with 186 additions and 186 deletions.
6 changes: 3 additions & 3 deletions src/bthread/bthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_BTHREAD_H
#define BAIDU_BTHREAD_BTHREAD_H
#ifndef BTHREAD_BTHREAD_H
#define BTHREAD_BTHREAD_H

#include <pthread.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -326,4 +326,4 @@ extern void* bthread_getspecific(bthread_key_t key) __THROW;

__END_DECLS

#endif // BAIDU_BTHREAD_BTHREAD_H
#endif // BTHREAD_BTHREAD_H
6 changes: 3 additions & 3 deletions src/bthread/butex.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 22 17:30:12 CST 2014

#ifndef BAIDU_BTHREAD_BUTEX_H
#define BAIDU_BTHREAD_BUTEX_H
#ifndef BTHREAD_BUTEX_H
#define BTHREAD_BUTEX_H

#include <errno.h> // users need to check errno
#include <time.h> // timespec
Expand Down Expand Up @@ -69,4 +69,4 @@ int butex_wait(void* butex, int expected_value, const timespec* abstime);

} // namespace bthread

#endif // BAIDU_BTHREAD_BUTEX_H
#endif // BTHREAD_BUTEX_H
6 changes: 3 additions & 3 deletions src/bthread/comlog_initializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Mon Sep 15 10:51:15 CST 2014

#ifndef PUBLIC_BTHREAD_BTHREAD_COMLOG_INITIALIZER_H
#define PUBLIC_BTHREAD_BTHREAD_COMLOG_INITIALIZER_H
#ifndef BTHREAD_COMLOG_INITIALIZER_H
#define BTHREAD_COMLOG_INITIALIZER_H

#include <com_log.h> // com_openlog_r, com_closelog_r
#include <butil/macros.h>
Expand All @@ -43,4 +43,4 @@ class ComlogInitializer {

}

#endif // PUBLIC_BTHREAD_BTHREAD_COMLOG_INITIALIZER_H
#endif // BTHREAD_COMLOG_INITIALIZER_H
6 changes: 3 additions & 3 deletions src/bthread/countdown_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Zhangyi Chen ([email protected])
// Date: 2016/06/03 13:06:40

#ifndef PUBLIC_BTHREAD_COUNTDOWN_EVENT_H
#define PUBLIC_BTHREAD_COUNTDOWN_EVENT_H
#ifndef BTHREAD_COUNTDOWN_EVENT_H
#define BTHREAD_COUNTDOWN_EVENT_H

#include "bthread/bthread.h"

Expand Down Expand Up @@ -55,4 +55,4 @@ class CountdownEvent {

} // namespace bthread

#endif //PUBLIC_BTHREAD_COUNTDOWN_EVENT_H
#endif // BTHREAD_COUNTDOWN_EVENT_H
6 changes: 3 additions & 3 deletions src/bthread/errno.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Wed Jul 30 11:47:19 CST 2014

#ifndef BAIDU_BTHREAD_ERRNO_H
#define BAIDU_BTHREAD_ERRNO_H
#ifndef BTHREAD_ERRNO_H
#define BTHREAD_ERRNO_H

#include <errno.h> // errno
#include "butil/errno.h" // berror(), DEFINE_BTHREAD_ERRNO
Expand All @@ -36,4 +36,4 @@ extern const int ESTOP;

__END_DECLS

#endif //BAIDU_BTHREAD_ERRNO_H
#endif //BTHREAD_ERRNO_H
6 changes: 3 additions & 3 deletions src/bthread/id.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_BTHREAD_ID_H
#define BAIDU_BTHREAD_BTHREAD_ID_H
#ifndef BTHREAD_ID_H
#define BTHREAD_ID_H

#include "butil/macros.h" // BAIDU_SYMBOLSTR
#include "bthread/types.h"
Expand Down Expand Up @@ -187,4 +187,4 @@ int bthread_id_list_reset2_bthreadsafe(bthread_id_list_t* list, int error_code,
bthread_mutex_t* mutex) __THROW;
#endif

#endif // BAIDU_BTHREAD_BTHREAD_ID_H
#endif // BTHREAD_ID_H
6 changes: 3 additions & 3 deletions src/bthread/interrupt_pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_INTERRUPT_PTHREAD_H
#define BAIDU_BTHREAD_INTERRUPT_PTHREAD_H
#ifndef BTHREAD_INTERRUPT_PTHREAD_H
#define BTHREAD_INTERRUPT_PTHREAD_H

#include <pthread.h>

Expand All @@ -29,4 +29,4 @@ int interrupt_pthread(pthread_t th);

} // namespace bthread

#endif // BAIDU_BTHREAD_INTERRUPT_PTHREAD_H
#endif // BTHREAD_INTERRUPT_PTHREAD_H
6 changes: 3 additions & 3 deletions src/bthread/list_of_abafree_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Mon Jun 20 11:57:23 CST 2016

#ifndef BAIDU_BTHREAD_LIST_OF_ABAFREE_ID_H
#define BAIDU_BTHREAD_LIST_OF_ABAFREE_ID_H
#ifndef BTHREAD_LIST_OF_ABAFREE_ID_H
#define BTHREAD_LIST_OF_ABAFREE_ID_H

#include <vector>
#include <deque>
Expand Down Expand Up @@ -209,4 +209,4 @@ size_t ListOfABAFreeId<Id, IdTraits>::get_sizes(size_t* cnts, size_t n) {

} // namespace bthread

#endif // BAIDU_BTHREAD_LIST_OF_ABAFREE_ID_H
#endif // BTHREAD_LIST_OF_ABAFREE_ID_H
6 changes: 3 additions & 3 deletions src/bthread/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
// Author: Ge,Jun ([email protected])
// Date: Mon Sep 15 10:51:15 CST 2014

#ifndef BAIDU_BTHREAD_LOG_H
#define BAIDU_BTHREAD_LOG_H
#ifndef BTHREAD_LOG_H
#define BTHREAD_LOG_H

#ifdef BAIDU_INTERNAL
#include "bthread/comlog_initializer.h"
#endif

#define BT_VLOG VLOG(100)

#endif // BAIDU_BTHREAD_LOG_H
#endif // BTHREAD_LOG_H
6 changes: 3 additions & 3 deletions src/bthread/parking_lot.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: [email protected], [email protected]
// Date: 2017/07/27 23:07:06

#ifndef PUBLIC_BTHREAD_PARKING_LOT_H
#define PUBLIC_BTHREAD_PARKING_LOT_H
#ifndef BTHREAD_PARKING_LOT_H
#define BTHREAD_PARKING_LOT_H

#include "butil/atomicops.h"
#include "bthread/sys_futex.h"
Expand Down Expand Up @@ -69,4 +69,4 @@ class BAIDU_CACHELINE_ALIGNMENT ParkingLot {

} // namespace bthread

#endif //PUBLIC_BTHREAD_PARKING_LOT_H
#endif // BTHREAD_PARKING_LOT_H
6 changes: 3 additions & 3 deletions src/bthread/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Fri Dec 5 13:40:57 CST 2014

#ifndef BAIDU_BTHREAD_PROCESSOR_H
#define BAIDU_BTHREAD_PROCESSOR_H
#ifndef BTHREAD_PROCESSOR_H
#define BTHREAD_PROCESSOR_H

// Pause instruction to prevent excess processor bus usage, only works in GCC
# ifndef cpu_relax
Expand All @@ -44,4 +44,4 @@
errno = saved_errno; \
} while (0)

#endif // BAIDU_BTHREAD_PROCESSOR_H
#endif // BTHREAD_PROCESSOR_H
6 changes: 3 additions & 3 deletions src/bthread/remote_task_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Sun, 22 Jan 2017

#ifndef BAIDU_BTHREAD_REMOTE_TASK_QUEUE_H
#define BAIDU_BTHREAD_REMOTE_TASK_QUEUE_H
#ifndef BTHREAD_REMOTE_TASK_QUEUE_H
#define BTHREAD_REMOTE_TASK_QUEUE_H

#include "butil/containers/bounded_queue.h"
#include "butil/macros.h"
Expand Down Expand Up @@ -77,4 +77,4 @@ friend class TaskGroup;

} // namespace bthread

#endif // BAIDU_BTHREAD_REMOTE_TASK_QUEUE_H
#endif // BTHREAD_REMOTE_TASK_QUEUE_H
6 changes: 3 additions & 3 deletions src/bthread/stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Sun Sep 7 22:37:39 CST 2014

#ifndef BAIDU_BTHREAD_ALLOCATE_STACK_H
#define BAIDU_BTHREAD_ALLOCATE_STACK_H
#ifndef BTHREAD_ALLOCATE_STACK_H
#define BTHREAD_ALLOCATE_STACK_H

#include <assert.h>
#include <gflags/gflags.h> // DECLARE_int32
Expand Down Expand Up @@ -77,4 +77,4 @@ void jump_stack(ContextualStack* from, ContextualStack* to);

#include "bthread/stack_inl.h"

#endif // BAIDU_BTHREAD_ALLOCATE_STACK_H
#endif // BTHREAD_ALLOCATE_STACK_H
6 changes: 3 additions & 3 deletions src/bthread/stack_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Sun Sep 7 22:37:39 CST 2014

#ifndef BAIDU_BTHREAD_ALLOCATE_STACK_INL_H
#define BAIDU_BTHREAD_ALLOCATE_STACK_INL_H
#ifndef BTHREAD_ALLOCATE_STACK_INL_H
#define BTHREAD_ALLOCATE_STACK_INL_H

DECLARE_int32(guard_page_size);
DECLARE_int32(tc_stack_small);
Expand Down Expand Up @@ -192,4 +192,4 @@ template <> struct ObjectPoolValidator<

} // namespace butil

#endif // BAIDU_BTHREAD_ALLOCATE_STACK_INL_H
#endif // BTHREAD_ALLOCATE_STACK_INL_H
6 changes: 3 additions & 3 deletions src/bthread/sys_futex.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_SYS_FUTEX_H
#define BAIDU_BTHREAD_SYS_FUTEX_H
#ifndef BTHREAD_SYS_FUTEX_H
#define BTHREAD_SYS_FUTEX_H

#include <syscall.h> // SYS_futex
#include <unistd.h> // syscall
Expand Down Expand Up @@ -46,4 +46,4 @@ inline int futex_requeue_private(void* addr1, int nwake, void* addr2) {

} // namespace bthread

#endif // BAIDU_BTHREAD_SYS_FUTEX_H
#endif // BTHREAD_SYS_FUTEX_H
6 changes: 3 additions & 3 deletions src/bthread/task_control.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_TASK_CONTROL_H
#define BAIDU_BTHREAD_TASK_CONTROL_H
#ifndef BTHREAD_TASK_CONTROL_H
#define BTHREAD_TASK_CONTROL_H

#ifndef NDEBUG
#include <iostream> // std::ostream
Expand Down Expand Up @@ -122,4 +122,4 @@ inline bvar::LatencyRecorder& TaskControl::exposed_pending_time() {

} // namespace bthread

#endif // BAIDU_BTHREAD_TASK_CONTROL_H
#endif // BTHREAD_TASK_CONTROL_H
6 changes: 3 additions & 3 deletions src/bthread/task_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_TASK_GROUP_H
#define BAIDU_BTHREAD_TASK_GROUP_H
#ifndef BTHREAD_TASK_GROUP_H
#define BTHREAD_TASK_GROUP_H

#include "butil/time.h" // cpuwide_time_ns
#include "bthread/task_control.h"
Expand Down Expand Up @@ -250,4 +250,4 @@ friend class TaskControl;

#include "task_group_inl.h"

#endif // BAIDU_BTHREAD_TASK_GROUP_H
#endif // BTHREAD_TASK_GROUP_H
6 changes: 3 additions & 3 deletions src/bthread/task_group_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_TASK_GROUP_INL_H
#define BAIDU_BTHREAD_TASK_GROUP_INL_H
#ifndef BTHREAD_TASK_GROUP_INL_H
#define BTHREAD_TASK_GROUP_INL_H

namespace bthread {

Expand Down Expand Up @@ -103,4 +103,4 @@ inline void TaskGroup::flush_nosignal_tasks_remote() {

} // namespace bthread

#endif // BAIDU_BTHREAD_TASK_GROUP_INL_H
#endif // BTHREAD_TASK_GROUP_INL_H
6 changes: 3 additions & 3 deletions src/bthread/task_meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_TASK_META_H
#define BAIDU_BTHREAD_TASK_META_H
#ifndef BTHREAD_TASK_META_H
#define BTHREAD_TASK_META_H

#include <pthread.h> // pthread_spin_init
#include "bthread/butex.h" // butex_construct/destruct
Expand Down Expand Up @@ -121,4 +121,4 @@ struct TaskMeta {

} // namespace bthread

#endif // BAIDU_BTHREAD_TASK_META_H
#endif // BTHREAD_TASK_META_H
6 changes: 3 additions & 3 deletions src/bthread/timer_thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@

// Author: Ge,Jun ([email protected])

#ifndef BAIDU_BTHREAD_TIMER_THREAD_H
#define BAIDU_BTHREAD_TIMER_THREAD_H
#ifndef BTHREAD_TIMER_THREAD_H
#define BTHREAD_TIMER_THREAD_H

#include <vector> // std::vector
#include <pthread.h> // pthread_*
Expand Down Expand Up @@ -106,4 +106,4 @@ TimerThread* get_global_timer_thread();

} // end namespace bthread

#endif // BAIDU_BTHREAD_TIMER_THREAD_H
#endif // BTHREAD_TIMER_THREAD_H
6 changes: 3 additions & 3 deletions src/bthread/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_BTHREAD_TYPES_H
#define BAIDU_BTHREAD_BTHREAD_TYPES_H
#ifndef BTHREAD_TYPES_H
#define BTHREAD_TYPES_H

#include <stdint.h> // uint64_t
#if defined(__cplusplus)
Expand Down Expand Up @@ -220,4 +220,4 @@ typedef struct {

typedef uint64_t bthread_timer_t;

#endif // BAIDU_BTHREAD_BTHREAD_TYPES_H
#endif // BTHREAD_TYPES_H
6 changes: 3 additions & 3 deletions src/bthread/unstable.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_BTHREAD_UNSTABLE_H
#define BAIDU_BTHREAD_BTHREAD_UNSTABLE_H
#ifndef BTHREAD_UNSTABLE_H
#define BTHREAD_UNSTABLE_H

#include <pthread.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -124,4 +124,4 @@ extern void bthread_keytable_pool_reserve(

__END_DECLS

#endif // BAIDU_BTHREAD_BTHREAD_UNSTABLE_H
#endif // BTHREAD_UNSTABLE_H
6 changes: 3 additions & 3 deletions src/bthread/work_stealing_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
// Author: Ge,Jun ([email protected])
// Date: Tue Jul 10 17:40:58 CST 2012

#ifndef BAIDU_BTHREAD_WORK_STEALING_QUEUE_H
#define BAIDU_BTHREAD_WORK_STEALING_QUEUE_H
#ifndef BTHREAD_WORK_STEALING_QUEUE_H
#define BTHREAD_WORK_STEALING_QUEUE_H

#include "butil/macros.h"
#include "butil/atomicops.h"
Expand Down Expand Up @@ -151,4 +151,4 @@ class WorkStealingQueue {

} // namespace bthread

#endif // BAIDU_BTHREAD_WORK_STEALING_QUEUE_H
#endif // BTHREAD_WORK_STEALING_QUEUE_H
Loading

0 comments on commit ef4eddd

Please sign in to comment.