diff --git a/CMakeLists.txt b/CMakeLists.txt index 34c7d72..511b150 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_EXTENSIONS OFF) option(SLED_BUILD_BENCHMARK "Build benchmark" OFF) +option(SLED_BUILD_TESTS "Build tests" OFF) set(BUILD_STATIC ON) set(BUILD_RTTR_DYNAMIC OFF) @@ -61,3 +62,8 @@ if(SLED_BUILD_BENCHMARK) target_link_libraries(sled_benchmark PRIVATE sled benchmark::benchmark benchmark::benchmark_main) endif(SLED_BUILD_BENCHMARK) + +if(SLED_BUILD_TESTS) + find_package(gtest REQUIRED) + add_executable(sled_tests "") +endif(SLED_BUILD_TESTS) diff --git a/include/sled/any.h b/include/sled/any.h index a282cef..1eabe1d 100644 --- a/include/sled/any.h +++ b/include/sled/any.h @@ -21,8 +21,9 @@ * (See accompanying file LICENSE.md or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#ifndef ANY_H -#define ANY_H +#pragma once +#ifndef SLED_ANY_H +#define SLED_ANY_H #include #include @@ -333,4 +334,4 @@ any_cast(any &&operand) }// namespace sled -#endif /* ANY_H */ +#endif /* SLED_ANY_H */ diff --git a/include/sled/buffer.h b/include/sled/buffer.h index 9ee80ca..ee03a1a 100644 --- a/include/sled/buffer.h +++ b/include/sled/buffer.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef BUFFER_H -#define BUFFER_H +#pragma once +#ifndef SLED_BUFFER_H +#define SLED_BUFFER_H #include #include #include @@ -275,4 +276,4 @@ using ZeroOnFreeBuffer = BufferT; }// namespace sled -#endif// BUFFER_H +#endif// SLED_BUFFER_H diff --git a/include/sled/byte_order.h b/include/sled/byte_order.h index c8b4299..943db08 100644 --- a/include/sled/byte_order.h +++ b/include/sled/byte_order.h @@ -1,3 +1,6 @@ +#progam once +#ifndef SLED_BYTE_ORDER_H +#define SLED_BYTE_ORDER_H #include #if defined(__APPLE__) @@ -48,3 +51,5 @@ NetworkToHost32(uint32_t n) { return be32toh(n); } + +#endif // SLED_BYTE_ORDER_H diff --git a/include/sled/cleanup.h b/include/sled/cleanup.h index cf225b6..14a9ee2 100644 --- a/include/sled/cleanup.h +++ b/include/sled/cleanup.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef CLEANUP_H -#define CLEANUP_H +#pragma once +#ifndef SLED_CLEANUP_H +#define SLED_CLEANUP_H #include "sled/optional.h" @@ -64,4 +65,4 @@ MakeCleanup(Callback callback) }// namespace sled -#endif// CLEANUP_H +#endif// SLED_CLEANUP_H diff --git a/include/sled/log/log.h b/include/sled/log/log.h index 390b15b..db04b23 100644 --- a/include/sled/log/log.h +++ b/include/sled/log/log.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef LOG_H -#define LOG_H +#pragma once +#ifndef SLED_LOG_LOG_H +#define SLED_LOG_LOG_H #include "sled/system/location.h" #include @@ -98,4 +99,4 @@ void Log(LogLevel level, #define ASSERT(cond, fmt, ...) SLOG_ASSERT(cond, "ASSERT", fmt, ##__VA_ARGS__) -#endif// LOG_H +#endif// SLED_LOG_LOG_H diff --git a/include/sled/make_ref_counted.h b/include/sled/make_ref_counted.h index e64158a..35a0540 100644 --- a/include/sled/make_ref_counted.h +++ b/include/sled/make_ref_counted.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef MAKE_REF_COUNTED_H -#define MAKE_REF_COUNTED_H +#pragma once +#ifndef SLED_MAKE_REF_COUNTED_H +#define SLED_MAKE_REF_COUNTED_H #include "sled/ref_count.h" #include "sled/ref_counted_object.h" @@ -73,4 +74,4 @@ make_ref_counted(Args &&...args) }// namespace sled -#endif// MAKE_REF_COUNTED_H +#endif// SLED_MAKE_REF_COUNTED_H diff --git a/include/sled/network/async_resolver.h b/include/sled/network/async_resolver.h index 07c473c..f397c23 100644 --- a/include/sled/network/async_resolver.h +++ b/include/sled/network/async_resolver.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef ASYNC_RESOLVER_H -#define ASYNC_RESOLVER_H +#pragma once +#ifndef SLED_NETWORK_ASYNC_RESOLVER_H +#define SLED_NETWORK_ASYNC_RESOLVER_H #include "sled/network/async_resolver_interface.h" #include "sled/scoped_refptr.h" @@ -41,4 +42,4 @@ private: }// namespace sled -#endif// ASYNC_RESOLVER_H +#endif// SLED_NETWORK_ASYNC_RESOLVER_H diff --git a/include/sled/network/async_resolver_interface.h b/include/sled/network/async_resolver_interface.h index 81b79cf..1495f0b 100644 --- a/include/sled/network/async_resolver_interface.h +++ b/include/sled/network/async_resolver_interface.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef ASYNC_RESOLVER_INTERFACE_H -#define ASYNC_RESOLVER_INTERFACE_H +#pragma once +#ifndef SLED_NETWORK_ASYNC_RESOLVER_INTERFACE_H +#define SLED_NETWORK_ASYNC_RESOLVER_INTERFACE_H #include "sled/network/socket_address.h" #include "sled/sigslot.h" @@ -35,4 +36,4 @@ public: }// namespace sled -#endif// ASYNC_RESOLVER_INTERFACE_H +#endif// SLED_NETWORK_ASYNC_RESOLVER_INTERFACE_H diff --git a/include/sled/network/ip_address.h b/include/sled/network/ip_address.h index a2269c6..3f0673a 100644 --- a/include/sled/network/ip_address.h +++ b/include/sled/network/ip_address.h @@ -4,8 +4,10 @@ * @license : MIT **/ -#ifndef IP_ADDRESS_H -#define IP_ADDRESS_H +#pragma once + +#ifndef SLED_NETWORK_IP_ADDRESS_H +#define SLED_NETWORK_IP_ADDRESS_H #include "sled/byte_order.h" #include @@ -95,4 +97,4 @@ bool IPIsUnspec(const IPAddress &ip); }// namespace sled -#endif// IP_ADDRESS_H +#endif// SLED_NETWORK_IP_ADDRESS_H diff --git a/include/sled/network/null_socket_server.h b/include/sled/network/null_socket_server.h index c6e5334..b53d6b8 100644 --- a/include/sled/network/null_socket_server.h +++ b/include/sled/network/null_socket_server.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef NULL_SOCKET_SERVER_H -#define NULL_SOCKET_SERVER_H +#pragma once +#ifndef SLED_NETWORK_NULL_SOCKET_SERVER_H +#define SLED_NETWORK_NULL_SOCKET_SERVER_H #include "sled/network/socket_server.h" #include "sled/synchronization/event.h" @@ -26,4 +27,4 @@ private: }// namespace sled -#endif// NULL_SOCKET_SERVER_H +#endif// SLED_NETWORK_NULL_SOCKET_SERVER_H diff --git a/include/sled/network/physical_socket_server.h b/include/sled/network/physical_socket_server.h index c87eca2..248534a 100644 --- a/include/sled/network/physical_socket_server.h +++ b/include/sled/network/physical_socket_server.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef PHYSICAL_SOCKET_SERVER_H -#define PHYSICAL_SOCKET_SERVER_H +#pragma once +#ifndef SLED_NETWORK_PHYSICAL_SOCKET_SERVER_H +#define SLED_NETWORK_PHYSICAL_SOCKET_SERVER_H #include "sled/network/async_resolver.h" #include "sled/sigslot.h" @@ -163,4 +164,4 @@ public: }// namespace sled -#endif// PHYSICAL_SOCKET_SERVER_H +#endif// SLED_NETWORK_PHYSICAL_SOCKET_SERVER_H diff --git a/include/sled/network/socket.h b/include/sled/network/socket.h index 4e04420..f0cfb1b 100644 --- a/include/sled/network/socket.h +++ b/include/sled/network/socket.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef SOCKET_H -#define SOCKET_H +#pragma once +#ifndef SLED_NETWORK_SOCKET_H +#define SLED_NETWORK_SOCKET_H #include "sled/network/socket_address.h" #include "sled/sigslot.h" @@ -75,4 +76,4 @@ protected: }// namespace sled -#endif// SOCKET_H +#endif// SLED_NETWORK_SOCKET_H diff --git a/include/sled/network/socket_address.h b/include/sled/network/socket_address.h index 219d4d9..73af897 100644 --- a/include/sled/network/socket_address.h +++ b/include/sled/network/socket_address.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef SOCKET_ADDRESS_H -#define SOCKET_ADDRESS_H +#pragma once +#ifndef SLED_NETWORK_SOCKET_ADDRESS_H +#define SLED_NETWORK_SOCKET_ADDRESS_H #include "sled/network/ip_address.h" @@ -68,4 +69,4 @@ bool SocketAddressFromSockAddrStorage(const sockaddr_storage &saddr, SocketAddress *out); }// namespace sled -#endif// SOCKET_ADDRESS_H +#endif// SLED_NETWORK_SOCKET_ADDRESS_H diff --git a/include/sled/network/socket_factory.h b/include/sled/network/socket_factory.h index bfbf44d..a4a0f37 100644 --- a/include/sled/network/socket_factory.h +++ b/include/sled/network/socket_factory.h @@ -4,8 +4,10 @@ * @license : MIT **/ -#ifndef SOCKET_FACTORY_H -#define SOCKET_FACTORY_H +#pragma once + +#ifndef SLED_NETWORK_SOCKET_FACTORY_H +#define SLED_NETWORK_SOCKET_FACTORY_H #include "sled/network/socket.h" @@ -19,4 +21,4 @@ public: }// namespace sled -#endif// SOCKET_FACTORY_H +#endif// SLED_NETWORK_SOCKET_FACTORY_H diff --git a/include/sled/network/socket_server.h b/include/sled/network/socket_server.h index 42f2530..c79c4fc 100644 --- a/include/sled/network/socket_server.h +++ b/include/sled/network/socket_server.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef SOCKET_SERVER_H -#define SOCKET_SERVER_H +#pragma +#ifndef SLED_NETWORK_SOCKET_SERVER_H +#define SLED_NETWORK_SOCKET_SERVER_H #include "sled/network/socket_factory.h" #include "sled/units/time_delta.h" @@ -30,4 +31,4 @@ std::unique_ptr CreateDefaultSocketServer(); }// namespace sled -#endif// SOCKET_SERVER_H +#endif// SLED_NETWORK_SOCKET_SERVER_H diff --git a/include/sled/numerics/divide_round.h b/include/sled/numerics/divide_round.h index 7c36c42..dade8b9 100644 --- a/include/sled/numerics/divide_round.h +++ b/include/sled/numerics/divide_round.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef DIVIDE_ROUND_H -#define DIVIDE_ROUND_H +#pragma once +#ifndef SLED_NUMERICS_DIVIDE_ROUND_H +#define SLED_NUMERICS_DIVIDE_ROUND_H #include @@ -43,4 +44,4 @@ DivideRoundToNearst(Dividend dividend, Divisor divisor) -> decltype(Dividend() / }// namespace sled -#endif// DIVIDE_ROUND_H +#endif// SLED_NUMERICS_DIVIDE_ROUND_H diff --git a/include/sled/numerics/fixed_point_number.h b/include/sled/numerics/fixed_point_number.h index fdc3238..f4c5a14 100644 --- a/include/sled/numerics/fixed_point_number.h +++ b/include/sled/numerics/fixed_point_number.h @@ -21,6 +21,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#pragma once #ifndef FIXED_POINT_H_ #define FIXED_POINT_H_ #include diff --git a/include/sled/operations_chain.h b/include/sled/operations_chain.h index f72c729..3f210cb 100644 --- a/include/sled/operations_chain.h +++ b/include/sled/operations_chain.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef OPERATIONS_CHAIN_H -#define OPERATIONS_CHAIN_H +#pragma once +#ifndef SLED_OPERATIONS_CHAIN_H +#define SLED_OPERATIONS_CHAIN_H #include "sled/optional.h" #include "sled/ref_counted_base.h" @@ -94,4 +95,4 @@ private: }// namespace sled -#endif// OPERATIONS_CHAIN_H +#endif// SLED_OPERATIONS_CHAIN_H diff --git a/include/sled/optional.h b/include/sled/optional.h index 0354ce7..0066508 100644 --- a/include/sled/optional.h +++ b/include/sled/optional.h @@ -14,8 +14,9 @@ // . /// -#ifndef TL_OPTIONAL_HPP -#define TL_OPTIONAL_HPP +#pragma once +#ifndef SLED_TL_OPTIONAL_HPP +#define SLED_TL_OPTIONAL_HPP #define TL_OPTIONAL_VERSION_MAJOR 1 #define TL_OPTIONAL_VERSION_MINOR 1 @@ -2496,4 +2497,4 @@ struct hash> { }; }// namespace std -#endif +#endif // SLED_TL_OPTIONAL_HPP diff --git a/include/sled/queue/circle_queue.h b/include/sled/queue/circle_queue.h index 11eafd8..daed31b 100644 --- a/include/sled/queue/circle_queue.h +++ b/include/sled/queue/circle_queue.h @@ -4,8 +4,8 @@ * @license : MIT **/ -#ifndef CIRCLE_QUEUE_H -#define CIRCLE_QUEUE_H +#ifndef SLED_QUEUE_CIRCLE_QUEUE_H +#define SLED_QUEUE_CIRCLE_QUEUE_H #include "sled/log/log.h" #include @@ -66,4 +66,4 @@ private: }// namespace sled -#endif// CIRCLE_QUEUE_H +#endif// SLED_QUEUE_CIRCLE_QUEUE_H diff --git a/include/sled/random.h b/include/sled/random.h index 36482f9..b667aaa 100644 --- a/include/sled/random.h +++ b/include/sled/random.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef RANDOM_H -#define RANDOM_H +#pragma once +#ifndef SLED_RANDOM_H +#define SLED_RANDOM_H #include #include @@ -56,4 +57,4 @@ bool Random::Rand() const; }// namespace sled -#endif// RANDOM_H +#endif// SLED_RANDOM_H diff --git a/include/sled/ref_count.h b/include/sled/ref_count.h index 4a49f0a..0cc1ef3 100644 --- a/include/sled/ref_count.h +++ b/include/sled/ref_count.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef REF_COUNT_H -#define REF_COUNT_H +#pragma once +#ifndef SLED_REF_COUNT_H +#define SLED_REF_COUNT_H namespace sled { @@ -22,4 +23,4 @@ protected: }// namespace sled -#endif// REF_COUNT_H +#endif// SLED_REF_COUNT_H diff --git a/include/sled/ref_counted_base.h b/include/sled/ref_counted_base.h index eb618a5..3b6492d 100644 --- a/include/sled/ref_counted_base.h +++ b/include/sled/ref_counted_base.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef REF_COUNTED_BASE_H -#define REF_COUNTED_BASE_H +#pragma once +#ifndef SLED_REF_COUNTED_BASE_H +#define SLED_REF_COUNTED_BASE_H #include "sled/ref_count.h" #include "sled/ref_counter.h" @@ -68,4 +69,4 @@ private: }// namespace sled -#endif// REF_COUNTED_BASE_H +#endif// SLED_REF_COUNTED_BASE_H diff --git a/include/sled/ref_counted_object.h b/include/sled/ref_counted_object.h index 891808f..a93e8cf 100644 --- a/include/sled/ref_counted_object.h +++ b/include/sled/ref_counted_object.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef REF_COUNTED_OBJECT_H -#define REF_COUNTED_OBJECT_H +#pragma once +#ifndef SLED_REF_COUNTED_OBJECT_H +#define SLED_REF_COUNTED_OBJECT_H #include "sled/ref_count.h" #include "sled/ref_counter.h" diff --git a/include/sled/ref_counter.h b/include/sled/ref_counter.h index f47bf06..28daaf2 100644 --- a/include/sled/ref_counter.h +++ b/include/sled/ref_counter.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef REF_COUNTER_H -#define REF_COUNTER_H +#pragma once +#ifndef SLED_REF_COUNTER_H +#define SLED_REF_COUNTER_H #include "sled/ref_count.h" #include @@ -42,4 +43,4 @@ private: }// namespace sled_impl }// namespace sled -#endif// REF_COUNTER_H +#endif// SLED_REF_COUNTER_H diff --git a/include/sled/reflect/reflect.h b/include/sled/reflect/reflect.h index b11f23e..014e348 100644 --- a/include/sled/reflect/reflect.h +++ b/include/sled/reflect/reflect.h @@ -4,6 +4,7 @@ * @license : MIT **/ +#pragma #ifndef SLED_REFLECT_REFLECT_H #define SLED_REFLECT_REFLECT_H @@ -12,7 +13,7 @@ #endif #if defined(__META_PARSER__) -#define REFLECT_CLASS __attribute__((annotate("reflect-class"))) +#define CLASS(...) class __attribute__((annotate("reflect-class"))) #__VA_ARGS__ #define PROPERTY() __attribute__((annotate("reflect-property"))) #define METHOD() __attribute__((annotate("reflect-method"))) #else diff --git a/include/sled/scoped_refptr.h b/include/sled/scoped_refptr.h index 7d2f731..a6bbb9d 100644 --- a/include/sled/scoped_refptr.h +++ b/include/sled/scoped_refptr.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef SCOPED_REFPTR_H -#define SCOPED_REFPTR_H +#pragma once +#ifndef SLED_SCOPED_REFPTR_H +#define SLED_SCOPED_REFPTR_H #include @@ -187,4 +188,4 @@ operator<(const scoped_refptr &lhs, const scoped_refptr &rhs) }// namespace sled -#endif// SCOPED_REFPTR_H +#endif// SLED_SCOPED_REFPTR_H diff --git a/include/sled/sequence_checker.h b/include/sled/sequence_checker.h index 3961a36..d151f11 100644 --- a/include/sled/sequence_checker.h +++ b/include/sled/sequence_checker.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef SEQUENCE_CHECKER_H -#define SEQUENCE_CHECKER_H +#pragma once +#ifndef SLED_SEQUENCE_CHECKER_H +#define SLED_SEQUENCE_CHECKER_H namespace sled { @@ -21,4 +22,4 @@ public: }// namespace sled -#endif// SEQUENCE_CHECKER_H +#endif// SLED_SEQUENCE_CHECKER_H diff --git a/include/sled/sigslot.h b/include/sled/sigslot.h index af6b390..6efb1d2 100644 --- a/include/sled/sigslot.h +++ b/include/sled/sigslot.h @@ -94,8 +94,9 @@ // If signalx is single threaded the user must ensure that disconnect, connect // or signal is not happening concurrently or data race may occur. -#ifndef RTC_BASE_THIRD_PARTY_SIGSLOT_SIGSLOT_H_ -#define RTC_BASE_THIRD_PARTY_SIGSLOT_SIGSLOT_H_ +#pragma once +#ifndef SLED_SIGSLOT_H +#define SLED_SIGSLOT_H #include #include @@ -686,4 +687,4 @@ using signal8 = }// namespace sigslot -#endif /* RTC_BASE_THIRD_PARTY_SIGSLOT_SIGSLOT_H_ */ +#endif // SLED_SIGSLOT_H diff --git a/include/sled/status.h b/include/sled/status.h index c9b5ce6..9b62687 100644 --- a/include/sled/status.h +++ b/include/sled/status.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef STATUS_H -#define STATUS_H +#pragma once +#ifndef SLED_STATUS_H +#define SLED_STATUS_H #include #include @@ -108,4 +109,4 @@ std::ostream &operator<<(std::ostream &os, Status const &status); }// namespace sled -#endif// STATUS_H +#endif// SLED_STATUS_H diff --git a/include/sled/status_or.h b/include/sled/status_or.h index 6fe1d00..3356431 100644 --- a/include/sled/status_or.h +++ b/include/sled/status_or.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef STATUS_OR_H -#define STATUS_OR_H +#pragma once +#ifndef SLED_STATUS_OR_H +#define SLED_STATUS_OR_H #include "sled/optional.h" #include "sled/status.h" #include @@ -161,4 +162,4 @@ make_status_or(StatusCode code, std::string message = "", ErrorInfo info = {}) }// namespace sled -#endif// STATUS_OR_H +#endif// SLED_STATUS_OR_H diff --git a/include/sled/strings/base64.h b/include/sled/strings/base64.h index 9f9d504..e37f2b8 100644 --- a/include/sled/strings/base64.h +++ b/include/sled/strings/base64.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef BASE64_H -#define BASE64_H +#pragma once +#ifndef SLED_STRINGS_BASE64_H +#define SLED_STRINGS_BASE64_H #include "sled/status_or.h" #include @@ -20,4 +21,4 @@ public: }// namespace sled -#endif// BASE64_H +#endif// SLED_STRINGS_BASE64_H diff --git a/include/sled/strings/utils.h b/include/sled/strings/utils.h new file mode 100644 index 0000000..a1dddda --- /dev/null +++ b/include/sled/strings/utils.h @@ -0,0 +1,10 @@ +#ifndef SLED_STRINGS_UTILS_H +#define SLED_STRINGS_UTILS_H +namespace sled { + +std::string ToLower(const std::string &str); +std::string ToUpper(const std::string &str); +std::string ToHex(const std::string &str); + +} // namespace sled +#endif // SLED_STRINGS_UTILS_H diff --git a/include/sled/synchronization/event.h b/include/sled/synchronization/event.h index 4608008..1b4c4bc 100644 --- a/include/sled/synchronization/event.h +++ b/include/sled/synchronization/event.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef EVENT_H -#define EVENT_H +#pragma once +#ifndef SLED_SYNCHRONIZATION_EVENT_H +#define SLED_SYNCHRONIZATION_EVENT_H #include "sled/synchronization/mutex.h" #include "sled/units/time_delta.h" @@ -40,4 +41,4 @@ public: }// namespace sled -#endif// EVENT_H +#endif// SLED_SYNCHRONIZATION_EVENT_H diff --git a/include/sled/synchronization/mutex.h b/include/sled/synchronization/mutex.h index 95a5766..daf62e7 100644 --- a/include/sled/synchronization/mutex.h +++ b/include/sled/synchronization/mutex.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef MUTEX_H -#define MUTEX_H +#pragma once +#ifndef SLED_SYNCHRONIZATION_MUTEX_H +#define SLED_SYNCHRONIZATION_MUTEX_H #include "sled/units/time_delta.h" #include @@ -159,4 +160,4 @@ private: }// namespace sled -#endif// MUTEX_H +#endif// SLED_SYNCHRONIZATION_MUTEX_H diff --git a/include/sled/synchronization/one_time_event.h b/include/sled/synchronization/one_time_event.h index 25e744e..4bd31e9 100644 --- a/include/sled/synchronization/one_time_event.h +++ b/include/sled/synchronization/one_time_event.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef ONE_TIME_EVENT_H -#define ONE_TIME_EVENT_H +#pragma once +#ifndef SLED_SYNCHRONIZATION_ONE_TIME_EVENT_H +#define SLED_SYNCHRONIZATION_ONE_TIME_EVENT_H #include "sled/synchronization/mutex.h" @@ -44,4 +45,4 @@ private: }; }// namespace sled -#endif// ONE_TIME_EVENT_H +#endif// SLED_SYNCHRONIZATION_ONE_TIME_EVENT_H diff --git a/include/sled/synchronization/sequence_checker_internal.h b/include/sled/synchronization/sequence_checker_internal.h index 9b94594..a5c55af 100644 --- a/include/sled/synchronization/sequence_checker_internal.h +++ b/include/sled/synchronization/sequence_checker_internal.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef SEQUENCE_CHECKER_INTERNAL_H -#define SEQUENCE_CHECKER_INTERNAL_H +#pragma once +#ifndef SLED_SYNCHRONIZATION_SEQUENCE_CHECKER_INTERNAL_H +#define SLED_SYNCHRONIZATION_SEQUENCE_CHECKER_INTERNAL_H #include "sled/synchronization/mutex.h" #include @@ -53,4 +54,4 @@ ExpectationToString(const ThreadLikeObject *checker) }// namespace sled -#endif// SEQUENCE_CHECKER_INTERNAL_H +#endif// SLED_SYNCHRONIZATION_SEQUENCE_CHECKER_INTERNAL_H diff --git a/include/sled/synchronization/thread_local.h b/include/sled/synchronization/thread_local.h index fbd9356..fd0a66b 100644 --- a/include/sled/synchronization/thread_local.h +++ b/include/sled/synchronization/thread_local.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef THREAD_LOCAL_H -#define THREAD_LOCAL_H +#pragma once +#ifndef SLED_SYNCHRONIZATION_THREAD_LOCAL_H +#define SLED_SYNCHRONIZATION_THREAD_LOCAL_H #include #include #include @@ -92,4 +93,4 @@ private: }// namespace sled -#endif// THREAD_LOCAL_H +#endif// SLED_SYNCHRONIZATION_THREAD_LOCAL_H diff --git a/include/sled/system/location.h b/include/sled/system/location.h index ca2360c..86c494e 100644 --- a/include/sled/system/location.h +++ b/include/sled/system/location.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef LOCATION_H -#define LOCATION_H +#pragma once +#ifndef SLED_SYSTEM_LOCATION_H +#define SLED_SYSTEM_LOCATION_H #include @@ -33,4 +34,4 @@ private: #define SLED_FROM_HERE sled::Location::Current(); -#endif// LOCATION_H +#endif// SLED_SYSTEM_LOCATION_H diff --git a/include/sled/system/thread.h b/include/sled/system/thread.h index 7484135..1466893 100644 --- a/include/sled/system/thread.h +++ b/include/sled/system/thread.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef THREAD_H -#define THREAD_H +#pragma once +#ifndef SLED_SYSTEM_THREAD_H +#define SLED_SYSTEM_THREAD_H #include "sled/synchronization/mutex.h" #include "sled/synchronization/thread_local.h" #include "sled/task_queue/task_queue_base.h" @@ -188,4 +189,4 @@ private: }// namespace sled -#endif// THREAD_H +#endif// SLED_SYSTEM_THREAD_H diff --git a/include/sled/system_time.h b/include/sled/system_time.h index a0bcdb1..688fff5 100644 --- a/include/sled/system_time.h +++ b/include/sled/system_time.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef SYSTEM_TIME_H -#define SYSTEM_TIME_H +#pragma once +#ifndef SLED_SYSTEM_TIME_H +#define SLED_SYSTEM_TIME_H #include namespace sled { @@ -14,4 +15,4 @@ int64_t SystemTimeNanos(); }// namespace sled -#endif// SYSTEM_TIME_H +#endif// SLED_SYSTEM_TIME_H diff --git a/include/sled/task_queue/pending_task_safety_flag.h b/include/sled/task_queue/pending_task_safety_flag.h index 781e183..799dd44 100644 --- a/include/sled/task_queue/pending_task_safety_flag.h +++ b/include/sled/task_queue/pending_task_safety_flag.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef PENDING_TASK_SAFETY_FLAG_H -#define PENDING_TASK_SAFETY_FLAG_H +#pragma once +#ifndef SLED_TASK_QUEUE_PENDING_TASK_SAFETY_FLAG_H +#define SLED_TASK_QUEUE_PENDING_TASK_SAFETY_FLAG_H #include "sled/ref_counted_base.h" #include "sled/scoped_refptr.h" @@ -35,4 +36,4 @@ private: }// namespace sled -#endif// PENDING_TASK_SAFETY_FLAG_H +#endif// SLED_TASK_QUEUE_PENDING_TASK_SAFETY_FLAG_H diff --git a/include/sled/task_queue/task_queue_base.h b/include/sled/task_queue/task_queue_base.h index 75544dd..7036a50 100644 --- a/include/sled/task_queue/task_queue_base.h +++ b/include/sled/task_queue/task_queue_base.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef TASK_QUEUE_BASE_H -#define TASK_QUEUE_BASE_H +#pragma once +#ifndef SLED_TASK_QUEUE_TASK_QUEUE_BASE_H +#define SLED_TASK_QUEUE_TASK_QUEUE_BASE_H #include "sled/system/location.h" #include "sled/units/time_delta.h" @@ -91,4 +92,4 @@ protected: }// namespace sled -#endif// TASK_QUEUE_BASE_H +#endif// SLED_TASK_QUEUE_TASK_QUEUE_BASE_H diff --git a/include/sled/time_utils.h b/include/sled/time_utils.h index 4378291..e469df1 100644 --- a/include/sled/time_utils.h +++ b/include/sled/time_utils.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef TIME_UNITS_H -#define TIME_UNITS_H +#pragma once +#ifndef SLED_TIME_UNITS_H +#define SLED_TIME_UNITS_H #include #include @@ -80,4 +81,4 @@ int64_t TimeUTCNanos(); }// namespace sled -#endif// TIME_UNITS_H +#endif// SLED_TIME_UNITS_H diff --git a/include/sled/units/time_delta.h b/include/sled/units/time_delta.h index 287a947..8e5c775 100644 --- a/include/sled/units/time_delta.h +++ b/include/sled/units/time_delta.h @@ -3,9 +3,10 @@ * @created : Saturday Feb 03, 2024 10:31:29 CST * @license : MIT **/ +#pragma once -#ifndef TIME_DELTA_H -#define TIME_DELTA_H +#ifndef SLED_UNITS_TIME_DELTA_H +#define SLED_UNITS_TIME_DELTA_H #include "sled/units/unit_base.h" #include @@ -104,4 +105,4 @@ operator<<(std::ostream &stream, TimeDelta value) }// namespace sled -#endif// TIME_DELTA_H +#endif// SLED_UNITS_TIME_DELTA_H diff --git a/include/sled/units/timestamp.h b/include/sled/units/timestamp.h index fba4906..923da4a 100644 --- a/include/sled/units/timestamp.h +++ b/include/sled/units/timestamp.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef TIMESTAMP_H -#define TIMESTAMP_H +#progma once +#ifndef SLED_UNITS_TIMESTAMP_H +#define SLED_UNITS_TIMESTAMP_H #include "sled/units/time_delta.h" #include "sled/units/unit_base.h" @@ -147,4 +148,4 @@ operator<<(std::ostream &stream, Timestamp value) }// namespace sled -#endif// TIMESTAMP_H +#endif// SLED_UNITS_TIMESTAMP_H diff --git a/include/sled/units/unit_base.h b/include/sled/units/unit_base.h index 9588e5c..affc33a 100644 --- a/include/sled/units/unit_base.h +++ b/include/sled/units/unit_base.h @@ -4,8 +4,9 @@ * @license : MIT **/ -#ifndef UNIT_BASE_H -#define UNIT_BASE_H +#pragma once +#ifndef SLED_UNITS_UNIT_BASE_H +#define SLED_UNITS_UNIT_BASE_H #include "sled/numerics/divide_round.h" #include @@ -311,4 +312,4 @@ operator-(RelativeUnit other) }// namespace sled -#endif// UNIT_BASE_H +#endif// SLED_UNITS_UNIT_BASE_H diff --git a/include/sled/variant.h b/include/sled/variant.h index 9303b8b..bed846d 100644 --- a/include/sled/variant.h +++ b/include/sled/variant.h @@ -5,8 +5,9 @@ // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) -#ifndef MPARK_VARIANT_HPP -#define MPARK_VARIANT_HPP +#pragma once +#ifndef SLED_MPARK_VARIANT_HPP +#define SLED_MPARK_VARIANT_HPP /* variant synopsis @@ -3038,4 +3039,4 @@ using namespace mpark; }// namespace sled -#endif// MPARK_VARIANT_HPP +#endif// SLED_MPARK_VARIANT_HPP