Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
ChuanqiXu9 committed Aug 6, 2024
1 parent eea2224 commit 5e794da
Show file tree
Hide file tree
Showing 46 changed files with 1,839 additions and 1,873 deletions.
2 changes: 1 addition & 1 deletion async_simple/Collect.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "async_simple/Future.h"
#include "async_simple/Try.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <stdexcept>
#include "async_simple/CommonMacros.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
// Different from assert, logicAssert is meaningful in
Expand Down
2 changes: 1 addition & 1 deletion async_simple/Executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "async_simple/experimental/coroutine.h"
#include "async_simple/util/move_only_function.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
// Stat information for an executor.
Expand Down
2 changes: 1 addition & 1 deletion async_simple/Future.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "async_simple/LocalState.h"
#include "async_simple/Traits.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/FutureState.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "async_simple/Try.h"
#include "async_simple/util/move_only_function.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/IOExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <cstdint>
#include <functional>

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/LocalState.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "async_simple/Executor.h"
#include "async_simple/Try.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/MoveWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef ASYNC_SIMPLE_USE_MODULES
#include <utility>

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/Promise.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "async_simple/Common.h"
#include "async_simple/Future.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/Traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef ASYNC_SIMPLE_USE_MODULES
#include "async_simple/Try.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/Try.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "async_simple/Common.h"
#include "async_simple/Unit.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
101 changes: 51 additions & 50 deletions async_simple/async_simple.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ module;
// translation units and the compiler is not able to handle such patterns
// efficiently.
//
// See https://clang.llvm.org/docs/StandardCPlusPlusModules.html#performance-tips
#include <version>
#include <cassert>
// See
// https://clang.llvm.org/docs/StandardCPlusPlusModules.html#performance-tips
#include <stdio.h>
#include <cassert>
#include <climits>
#include <version>

#ifdef __linux__
#include <sched.h>
Expand All @@ -24,64 +25,64 @@ export module async_simple;
import std;
#define ASYNC_SIMPLE_USE_MODULES
extern "C++" {
#include "util/move_only_function.h"
#include "coro/Traits.h"
#include "experimental/coroutine.h"
#include "coro/Traits.h"
#include "experimental/coroutine.h"
#include "util/move_only_function.h"
}
export extern "C++" {
#include "MoveWrapper.h"
#include "Executor.h"
#include "Executor.h"
#include "MoveWrapper.h"
}
extern "C++" {
#include "CommonMacros.h"
#include "Common.h"
#include "Unit.h"
#include "Common.h"
#include "CommonMacros.h"
#include "Unit.h"
}
export extern "C++" {
#include "Try.h"
#include "Try.h"
}
extern "C++" {
#include "FutureState.h"
#include "LocalState.h"
#include "Traits.h"
#include "FutureState.h"
#include "LocalState.h"
#include "Traits.h"
}
export extern "C++" {
#include "Future.h"
#include "Promise.h"
#include "coro/DetachedCoroutine.h"
#include "coro/ViaCoroutine.h"
#include "coro/Lazy.h"
#include "Future.h"
#include "Promise.h"
#include "coro/DetachedCoroutine.h"
#include "coro/Lazy.h"
#include "coro/ViaCoroutine.h"
}
extern "C++" {
#include "uthread/internal/thread_impl.h"
#include "uthread/internal/thread.h"
#include "uthread/internal/thread.h"
#include "uthread/internal/thread_impl.h"
}
export extern "C++" {
#include "uthread/Await.h"
#include "uthread/Latch.h"
#include "uthread/Uthread.h"
#include "uthread/Async.h"
#include "coro/ConditionVariable.h"
#include "coro/SpinLock.h"
#include "coro/Latch.h"
#include "coro/CountEvent.h"
#include "coro/Collect.h"
#include "IOExecutor.h"
#include "coro/SharedMutex.h"
#include "uthread/Collect.h"
#include "coro/PromiseAllocator.h"
#include "executors/SimpleIOExecutor.h"
#include "coro/Mutex.h"
#include "Collect.h"
#include "util/Condition.h"
#include "coro/Dispatch.h"
#include "coro/Sleep.h"
#include "util/Queue.h"
#include "util/ThreadPool.h"
#include "coro/ResumeBySchedule.h"
#include "coro/FutureAwaiter.h"
#include "coro/SyncAwait.h"
#include "executors/SimpleExecutor.h"
#include "coro/Semaphore.h"
#include "coro/Generator.h"
export extern "C++" {
#include "Collect.h"
#include "IOExecutor.h"
#include "coro/Collect.h"
#include "coro/ConditionVariable.h"
#include "coro/CountEvent.h"
#include "coro/Dispatch.h"
#include "coro/FutureAwaiter.h"
#include "coro/Generator.h"
#include "coro/Latch.h"
#include "coro/Mutex.h"
#include "coro/PromiseAllocator.h"
#include "coro/ResumeBySchedule.h"
#include "coro/Semaphore.h"
#include "coro/SharedMutex.h"
#include "coro/Sleep.h"
#include "coro/SpinLock.h"
#include "coro/SyncAwait.h"
#include "executors/SimpleExecutor.h"
#include "executors/SimpleIOExecutor.h"
#include "uthread/Async.h"
#include "uthread/Await.h"
#include "uthread/Collect.h"
#include "uthread/Latch.h"
#include "uthread/Uthread.h"
#include "util/Condition.h"
#include "util/Queue.h"
#include "util/ThreadPool.h"
}
2 changes: 1 addition & 1 deletion async_simple/coro/Collect.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include "async_simple/coro/Lazy.h"
#include "async_simple/experimental/coroutine.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
namespace coro {
Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/ConditionVariable.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <mutex>
#include "async_simple/coro/Lazy.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
namespace coro {
Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/CountEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <utility>
#include "async_simple/experimental/coroutine.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/DetachedCoroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <exception>
#include "async_simple/experimental/coroutine.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/Dispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <cassert>
#include <type_traits>

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
namespace coro {
Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/FutureAwaiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include <type_traits>

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/Generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#ifndef ASYNC_SIMPLE_USE_MODULES
#include <generator>
#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple::coro {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/Latch.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "async_simple/coro/Lazy.h"
#include "async_simple/coro/SpinLock.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple::coro {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/Lazy.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "async_simple/coro/ViaCoroutine.h"
#include "async_simple/experimental/coroutine.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/Mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <mutex>
#include "async_simple/experimental/coroutine.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
namespace coro {
Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/PromiseAllocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// The reason why `__cpp_sized_deallocation` is not enabled is that it will
// cause ABI breaking
#if defined(__clang__) && defined(__GLIBCXX__)
#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

void operator delete[](void* p, std::size_t sz) noexcept;
#endif
Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/ResumeBySchedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <type_traits>
#include <utility>

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple::coro {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/Semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "async_simple/coro/ConditionVariable.h"
#include "async_simple/coro/SpinLock.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple::coro {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/SharedMutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "async_simple/coro/Lazy.h"
#include "async_simple/coro/SpinLock.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple::coro {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/Sleep.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "async_simple/Executor.h"
#include "async_simple/coro/Lazy.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
namespace coro {
Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/SpinLock.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <thread>
#include "async_simple/coro/Lazy.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
namespace coro {
Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/SyncAwait.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "async_simple/Try.h"
#include "async_simple/util/Condition.h"

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
namespace coro {
Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/Traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#ifndef ASYNC_SIMPLE_USE_MODULES
#include <utility>

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {

Expand Down
2 changes: 1 addition & 1 deletion async_simple/coro/ViaCoroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <cassert>
#include <utility>

#endif // ASYNC_SIMPLE_USE_MODULES
#endif // ASYNC_SIMPLE_USE_MODULES

namespace async_simple {
namespace coro {
Expand Down
Loading

0 comments on commit 5e794da

Please sign in to comment.