Commit 61bb10d4 authored by tqcq's avatar tqcq
Browse files

feat add #pragma once

parent 6d52a8e8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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)
+4 −3
Original line number Diff line number Diff line
@@ -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 <algorithm>
#include <memory>
@@ -333,4 +334,4 @@ any_cast(any &&operand)

}// namespace sled

#endif /* ANY_H */
#endif /* SLED_ANY_H */
+4 −3
Original line number Diff line number Diff line
@@ -4,8 +4,9 @@
 * @license  : MIT
 **/

#ifndef BUFFER_H
#define BUFFER_H
#pragma once
#ifndef SLED_BUFFER_H
#define SLED_BUFFER_H
#include <cstring>
#include <memory>
#include <stdint.h>
@@ -275,4 +276,4 @@ using ZeroOnFreeBuffer = BufferT<T, true>;

}// namespace sled

#endif// BUFFER_H
#endif// SLED_BUFFER_H
+5 −0
Original line number Diff line number Diff line
#progam once
#ifndef SLED_BYTE_ORDER_H
#define SLED_BYTE_ORDER_H
#include <arpa/inet.h>

#if defined(__APPLE__)
@@ -48,3 +51,5 @@ NetworkToHost32(uint32_t n)
{
    return be32toh(n);
}

#endif // SLED_BYTE_ORDER_H
+4 −3
Original line number Diff line number Diff line
@@ -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
Loading