From dee8a5180aa542d98d1b71c74f83a006e4627952 Mon Sep 17 00:00:00 2001 From: Sven Over Date: Fri, 1 Apr 2016 08:31:10 -0700 Subject: [PATCH] folly: replace old-style header guards with "pragma once" Summary:Most header files in folly already used "#pragma once" to protect against multiple inclusion. This diff removes old-style ifndef/define/endif header guards and replaces them with pragma once. In some cases the defined symbol is tested in other header files. In those cases the "#define" is kept. Reviewed By: igorsugak Differential Revision: D3054492 fb-gh-sync-id: 20aa0b9b926a30dd021e4b8f5440e8888874681c fbshipit-source-id: 20aa0b9b926a30dd021e4b8f5440e8888874681c --- folly/Arena.h | 4 +--- folly/Assume.h | 5 +---- folly/AtomicBitSet.h | 5 +---- folly/AtomicHashArray.h | 4 +--- folly/AtomicHashMap.h | 4 +--- folly/AtomicLinkedList.h | 5 +---- folly/AtomicStruct.h | 5 +---- folly/AtomicUnorderedMap.h | 5 ++--- folly/Baton.h | 5 +---- folly/Benchmark.h | 5 +---- folly/Bits.h | 5 +---- folly/CPortability.h | 5 +---- folly/Checksum.h | 5 +---- folly/ConcurrentSkipList-inl.h | 5 +---- folly/ConcurrentSkipList.h | 5 +---- folly/ContainerTraits.h | 5 +---- folly/Conv.h | 5 +---- folly/CppAttributes.h | 5 +---- folly/CpuId.h | 5 +---- folly/DiscriminatedPtr.h | 5 +---- folly/DynamicConverter.h | 5 +---- folly/EvictingCacheMap.h | 5 +---- folly/Exception.h | 5 +---- folly/ExceptionWrapper.h | 4 +--- folly/FBString.h | 5 +---- folly/FBVector.h | 5 +---- folly/File.h | 5 +---- folly/FileUtil.h | 5 +---- folly/Fingerprint.h | 5 +---- folly/Foreach.h | 5 +---- folly/Format.h | 4 +--- folly/FormatArg.h | 5 +---- folly/FormatTraits.h | 5 +---- folly/GroupVarint.h | 4 +--- folly/Hash.h | 5 +---- folly/IndexedMemPool.h | 4 +--- folly/IntrusiveList.h | 5 +---- folly/Lazy.h | 6 ++---- folly/LifoSem.h | 5 +---- folly/Likely.h | 5 +---- folly/Logging.h | 5 +---- folly/Malloc.h | 4 +--- folly/MapUtil.h | 5 +---- folly/Memory.h | 5 +---- folly/MemoryMapping.h | 5 +---- folly/Merge.h | 5 +---- folly/Optional.h | 5 +---- folly/PackedSyncPtr.h | 5 +---- folly/Padded.h | 5 +---- folly/Portability.h | 5 +---- folly/Preprocessor.h | 5 +---- folly/ProducerConsumerQueue.h | 5 +---- folly/RWSpinLock.h | 5 +---- folly/Random.h | 4 +--- folly/Range.h | 5 +---- folly/SafeAssert.h | 5 +---- folly/ScopeGuard.h | 5 +---- folly/SmallLocks.h | 5 +---- folly/SparseByteSet.h | 5 +---- folly/SpookyHashV1.h | 5 +---- folly/SpookyHashV2.h | 5 +---- folly/String-inl.h | 7 ++----- folly/String.h | 6 ++---- folly/Subprocess.h | 6 ++---- folly/Synchronized.h | 5 +---- folly/ThreadCachedArena.h | 5 +---- folly/ThreadCachedInt.h | 5 +---- folly/ThreadLocal.h | 5 +---- folly/TimeoutQueue.h | 5 +---- folly/Traits.h | 5 +---- folly/Unicode.h | 5 +---- folly/Uri.h | 4 +--- folly/Varint.h | 5 +---- folly/VersionCheck.h | 5 +---- folly/detail/AtomicHashUtils.h | 5 +---- folly/detail/BitIteratorDetail.h | 5 +---- folly/detail/BitsDetail.h | 5 +---- folly/detail/CacheLocality.h | 5 +---- folly/detail/ChecksumDetail.h | 5 +---- folly/detail/DiscriminatedPtrDetail.h | 5 +---- folly/detail/ExceptionWrapper.h | 5 +---- folly/detail/FileUtilDetail.h | 5 +---- folly/detail/FingerprintPolynomial.h | 5 +---- folly/detail/FunctionalExcept.h | 5 +---- folly/detail/GroupVarintDetail.h | 5 +---- folly/detail/Malloc.h | 5 +---- folly/detail/MemoryIdler.h | 5 +---- folly/detail/RangeCommon.h | 5 +---- folly/detail/RangeSse42.h | 5 +---- folly/detail/SlowFingerprint.h | 5 +---- folly/detail/Stats.h | 5 +---- folly/detail/ThreadLocalDetail.h | 5 +---- folly/detail/UncaughtExceptionCounter.h | 5 +---- folly/dynamic-inl.h | 5 +---- folly/dynamic.h | 5 +---- folly/experimental/BitVectorCoding.h | 5 +---- folly/experimental/Bits.h | 5 +---- folly/experimental/EliasFanoCoding.h | 5 +---- folly/experimental/EventCount.h | 5 +---- folly/experimental/FunctionScheduler.h | 5 +---- folly/experimental/Instructions.h | 5 +---- folly/experimental/NestedCommandLineApp.h | 5 +---- folly/experimental/ProgramOptions.h | 5 +---- folly/experimental/Select64.h | 5 +---- folly/experimental/StringKeyedCommon.h | 5 +---- folly/experimental/StringKeyedMap.h | 5 +---- folly/experimental/StringKeyedSet.h | 5 +---- folly/experimental/StringKeyedUnorderedMap.h | 5 +---- folly/experimental/StringKeyedUnorderedSet.h | 5 +---- folly/experimental/TestUtil.h | 5 +---- folly/experimental/TupleOps.h | 5 +---- folly/experimental/exception_tracer/ExceptionAbi.h | 6 +----- folly/experimental/exception_tracer/ExceptionTracer.h | 5 +---- folly/experimental/exception_tracer/ExceptionTracerLib.h | 5 +---- folly/experimental/exception_tracer/StackTrace.h | 6 +----- folly/experimental/io/AsyncIO.h | 5 +---- folly/experimental/io/FsUtil.h | 5 +---- folly/experimental/io/HugePages.h | 5 +---- folly/experimental/symbolizer/Dwarf.h | 5 +---- folly/experimental/symbolizer/Elf.h | 4 +--- folly/experimental/symbolizer/ElfCache.h | 5 +---- folly/experimental/symbolizer/LineReader.h | 5 +---- folly/experimental/symbolizer/SignalHandler.h | 5 +---- folly/experimental/symbolizer/StackTrace.h | 5 +---- folly/experimental/symbolizer/Symbolizer.h | 5 +---- folly/experimental/symbolizer/test/SignalHandlerTest.h | 5 +---- folly/experimental/test/CodingTestUtils.h | 5 +---- folly/gen/Base-inl.h | 2 +- folly/gen/Base.h | 6 ++---- folly/gen/Combine-inl.h | 2 +- folly/gen/Combine.h | 6 ++---- folly/gen/Core-inl.h | 2 +- folly/gen/Core.h | 6 ++---- folly/gen/File-inl.h | 2 +- folly/gen/File.h | 6 ++---- folly/gen/Parallel.h | 4 +--- folly/gen/ParallelMap-inl.h | 2 +- folly/gen/ParallelMap.h | 6 ++---- folly/gen/String-inl.h | 2 +- folly/gen/String.h | 6 ++---- folly/gen/test/Bench.h | 5 +---- folly/init/Init.h | 6 ++---- folly/io/Compression.h | 5 +---- folly/io/Cursor.h | 5 +---- folly/io/IOBuf.h | 5 +---- folly/io/IOBufQueue.h | 5 +---- folly/io/RecordIO.h | 5 ++--- folly/io/TypedIOBuf.h | 5 +---- folly/json.h | 5 +---- folly/portability/Constexpr.h | 5 +---- folly/portability/GFlags.h | 5 +---- folly/portability/SysUio.h | 5 +---- folly/small_vector.h | 6 ++---- folly/sorted_vector_types.h | 5 +---- folly/stats/BucketedTimeSeries-defs.h | 5 +---- folly/stats/BucketedTimeSeries.h | 5 +---- folly/stats/Histogram-defs.h | 5 +---- folly/stats/Histogram.h | 5 +---- folly/stats/MultiLevelTimeSeries-defs.h | 5 +---- folly/stats/MultiLevelTimeSeries.h | 5 +---- folly/stats/TimeseriesHistogram-defs.h | 5 +---- folly/stats/TimeseriesHistogram.h | 5 +---- folly/test/SynchronizedTestLib-inl.h | 6 +----- folly/test/SynchronizedTestLib.h | 5 +---- folly/test/TestUtils.h | 5 +---- folly/test/function_benchmark/benchmark_impl.h | 6 ++---- folly/test/function_benchmark/test_functions.h | 5 +---- 167 files changed, 182 insertions(+), 640 deletions(-) diff --git a/folly/Arena.h b/folly/Arena.h index daea8bc1..8b928b03 100644 --- a/folly/Arena.h +++ b/folly/Arena.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_ARENA_H_ +#pragma once #define FOLLY_ARENA_H_ #include @@ -243,5 +243,3 @@ struct IsArenaAllocator : std::true_type { }; } // namespace folly #include - -#endif /* FOLLY_ARENA_H_ */ diff --git a/folly/Assume.h b/folly/Assume.h index ca37c145..7c50a679 100644 --- a/folly/Assume.h +++ b/folly/Assume.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_BASE_ASSUME_H_ -#define FOLLY_BASE_ASSUME_H_ +#pragma once #include #include @@ -45,5 +44,3 @@ FOLLY_ALWAYS_INLINE void assume(bool cond) { } } // namespace folly - -#endif diff --git a/folly/AtomicBitSet.h b/folly/AtomicBitSet.h index 3d02d572..caa61e5a 100644 --- a/folly/AtomicBitSet.h +++ b/folly/AtomicBitSet.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_ATOMICBITSET_H_ -#define FOLLY_ATOMICBITSET_H_ +#pragma once #include #include @@ -158,5 +157,3 @@ inline bool AtomicBitSet::operator[](size_t idx) const { } } // namespaces - -#endif /* FOLLY_ATOMICBITSET_H_ */ diff --git a/folly/AtomicHashArray.h b/folly/AtomicHashArray.h index a66b4902..3269a01e 100644 --- a/folly/AtomicHashArray.h +++ b/folly/AtomicHashArray.h @@ -29,7 +29,7 @@ * @author Jordan DeLong */ -#ifndef FOLLY_ATOMICHASHARRAY_H_ +#pragma once #define FOLLY_ATOMICHASHARRAY_H_ #include @@ -429,5 +429,3 @@ friend class AtomicHashMap - -#endif // FOLLY_ATOMICHASHARRAY_H_ diff --git a/folly/AtomicHashMap.h b/folly/AtomicHashMap.h index 53c8d8af..b4a0563e 100644 --- a/folly/AtomicHashMap.h +++ b/folly/AtomicHashMap.h @@ -79,7 +79,7 @@ * */ -#ifndef FOLLY_ATOMICHASHMAP_H_ +#pragma once #define FOLLY_ATOMICHASHMAP_H_ #include @@ -472,5 +472,3 @@ using QuadraticProbingAtomicHashMap = } // namespace folly #include - -#endif // FOLLY_ATOMICHASHMAP_H_ diff --git a/folly/AtomicLinkedList.h b/folly/AtomicLinkedList.h index cf880c58..459036ef 100644 --- a/folly/AtomicLinkedList.h +++ b/folly/AtomicLinkedList.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_ATOMIC_LINKED_LIST_H_ -#define FOLLY_ATOMIC_LINKED_LIST_H_ +#pragma once #include #include @@ -134,5 +133,3 @@ class AtomicLinkedList { }; } // namespace folly - -#endif diff --git a/folly/AtomicStruct.h b/folly/AtomicStruct.h index d478b90c..0587b964 100644 --- a/folly/AtomicStruct.h +++ b/folly/AtomicStruct.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_ATOMIC_STRUCT_H_ -#define FOLLY_ATOMIC_STRUCT_H_ +#pragma once #include #include @@ -135,5 +134,3 @@ template <> struct AtomicStructIntPick<8> { typedef uint64_t type; }; } // namespace detail } // namespace folly - -#endif diff --git a/folly/AtomicUnorderedMap.h b/folly/AtomicUnorderedMap.h index eb361144..68fc585d 100644 --- a/folly/AtomicUnorderedMap.h +++ b/folly/AtomicUnorderedMap.h @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef FOLLY_ATOMICUNORDEREDMAP_H -#define FOLLY_ATOMICUNORDEREDMAP_H + +#pragma once #include #include @@ -519,4 +519,3 @@ struct MutableData { } -#endif diff --git a/folly/Baton.h b/folly/Baton.h index c14e57f3..c10f7146 100644 --- a/folly/Baton.h +++ b/folly/Baton.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_BATON_H -#define FOLLY_BATON_H +#pragma once #include #include @@ -297,5 +296,3 @@ struct Baton { }; } // namespace folly - -#endif diff --git a/folly/Benchmark.h b/folly/Benchmark.h index 7ca0b748..0a384b40 100644 --- a/folly/Benchmark.h +++ b/folly/Benchmark.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_BENCHMARK_H_ -#define FOLLY_BENCHMARK_H_ +#pragma once #include #include // for FB_ANONYMOUS_VARIABLE @@ -536,5 +535,3 @@ void doNotOptimizeAway(T&& datum) { if (auto FB_ANONYMOUS_VARIABLE(BENCHMARK_SUSPEND) = \ ::folly::BenchmarkSuspender()) {} \ else - -#endif // FOLLY_BENCHMARK_H_ diff --git a/folly/Bits.h b/folly/Bits.h index 61a7407d..9d91aefa 100644 --- a/folly/Bits.h +++ b/folly/Bits.h @@ -52,8 +52,7 @@ * @author Tudor Bosman (tudorb@fb.com) */ -#ifndef FOLLY_BITS_H_ -#define FOLLY_BITS_H_ +#pragma once #if !defined(__clang__) && !(defined(_MSC_VER) && (_MSC_VER < 1900)) #define FOLLY_INTRINSIC_CONSTEXPR constexpr @@ -574,5 +573,3 @@ inline void storeUnaligned(void* p, T value) { } } // namespace folly - -#endif /* FOLLY_BITS_H_ */ diff --git a/folly/CPortability.h b/folly/CPortability.h index 6f35319d..febf2a14 100644 --- a/folly/CPortability.h +++ b/folly/CPortability.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef CPORTABILITY_H -#define CPORTABILITY_H +#pragma once /* These definitions are in a separate file so that they * may be included from C- as well as C++-based projects. */ @@ -72,5 +71,3 @@ #else # define UBSAN_DISABLE(x) #endif // UNDEFINED_SANITIZER - -#endif // CPORTABILITY_H diff --git a/folly/Checksum.h b/folly/Checksum.h index 1168badf..12028933 100644 --- a/folly/Checksum.h +++ b/folly/Checksum.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_CHECKSUM_H_ -#define FOLLY_CHECKSUM_H_ +#pragma once #include #include @@ -39,5 +38,3 @@ uint32_t crc32c(const uint8_t* data, size_t nbytes, uint32_t startingChecksum = ~0U); } // folly - -#endif /* FOLLY_CHECKSUM_H_ */ diff --git a/folly/ConcurrentSkipList-inl.h b/folly/ConcurrentSkipList-inl.h index 8fd13b63..e4144bcb 100644 --- a/folly/ConcurrentSkipList-inl.h +++ b/folly/ConcurrentSkipList-inl.h @@ -16,8 +16,7 @@ // @author: Xin Liu -#ifndef FOLLY_CONCURRENTSKIPLIST_INL_H_ -#define FOLLY_CONCURRENTSKIPLIST_INL_H_ +#pragma once #include #include @@ -333,5 +332,3 @@ class NodeRecycler #include @@ -800,5 +799,3 @@ class ConcurrentSkipList::Skipper { }; } // namespace folly - -#endif // FOLLY_CONCURRENT_SKIP_LIST_H_ diff --git a/folly/ContainerTraits.h b/folly/ContainerTraits.h index c83f4600..4d6d0814 100644 --- a/folly/ContainerTraits.h +++ b/folly/ContainerTraits.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_BASE_CONTAINER_TRAITS_H_ -#define FOLLY_BASE_CONTAINER_TRAITS_H_ +#pragma once #include @@ -41,5 +40,3 @@ container_emplace_back_or_push_back(Container& container, Args&&... args) { } } - -#endif diff --git a/folly/Conv.h b/folly/Conv.h index d13ebcb2..eeeb3847 100644 --- a/folly/Conv.h +++ b/folly/Conv.h @@ -21,8 +21,7 @@ * @author Andrei Alexandrescu (andrei.alexandrescu@fb.com) */ -#ifndef FOLLY_BASE_CONV_H_ -#define FOLLY_BASE_CONV_H_ +#pragma once #include #include @@ -1287,5 +1286,3 @@ to(const Src & value) { #undef FOLLY_RANGE_CHECK_STRINGIZE #undef FOLLY_RANGE_CHECK_STRINGIZE2 #endif - -#endif /* FOLLY_BASE_CONV_H_ */ diff --git a/folly/CppAttributes.h b/folly/CppAttributes.h index 27bf267b..6bd6cfe3 100644 --- a/folly/CppAttributes.h +++ b/folly/CppAttributes.h @@ -20,8 +20,7 @@ * @author Dominik Gabi */ -#ifndef FOLLY_BASE_ATTRIBUTES_H_ -#define FOLLY_BASE_ATTRIBUTES_H_ +#pragma once #ifndef __has_cpp_attribute #define FOLLY_HAS_CPP_ATTRIBUTE(x) 0 @@ -76,5 +75,3 @@ #else #define FOLLY_NULLABLE #endif - -#endif /* FOLLY_BASE_ATTRIBUTES_H_ */ diff --git a/folly/CpuId.h b/folly/CpuId.h index 096fc8d1..fe3d58bb 100644 --- a/folly/CpuId.h +++ b/folly/CpuId.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_CPUID_H_ -#define FOLLY_CPUID_H_ +#pragma once #include #include @@ -196,5 +195,3 @@ class CpuId { }; } // namespace folly - -#endif /* FOLLY_CPUID_H_ */ diff --git a/folly/DiscriminatedPtr.h b/folly/DiscriminatedPtr.h index 2f76a658..24494eff 100644 --- a/folly/DiscriminatedPtr.h +++ b/folly/DiscriminatedPtr.h @@ -24,8 +24,7 @@ * @author Tudor Bosman (tudorb@fb.com) */ -#ifndef FOLLY_DISCRIMINATEDPTR_H_ -#define FOLLY_DISCRIMINATEDPTR_H_ +#pragma once #include #include @@ -217,5 +216,3 @@ class DiscriminatedPtr { }; } // namespace folly - -#endif /* FOLLY_DISCRIMINATEDPTR_H_ */ diff --git a/folly/DynamicConverter.h b/folly/DynamicConverter.h index 48bd7115..591f55a7 100644 --- a/folly/DynamicConverter.h +++ b/folly/DynamicConverter.h @@ -16,8 +16,7 @@ // @author Nicholas Ormrod -#ifndef DYNAMIC_CONVERTER_H -#define DYNAMIC_CONVERTER_H +#pragma once #include namespace folly { @@ -354,5 +353,3 @@ dynamic toDynamic(const T& x) { } } // namespace folly - -#endif // DYNAMIC_CONVERTER_H diff --git a/folly/EvictingCacheMap.h b/folly/EvictingCacheMap.h index 58073840..3059fb5e 100644 --- a/folly/EvictingCacheMap.h +++ b/folly/EvictingCacheMap.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EVICTINGHASHMAP_H_ -#define FOLLY_EVICTINGHASHMAP_H_ +#pragma once #include #include @@ -492,5 +491,3 @@ class EvictingCacheMap : private boost::noncopyable { }; } // folly - -#endif /* FOLLY_EVICTINGHASHMAP_H_ */ diff --git a/folly/Exception.h b/folly/Exception.h index 30444b2b..85bbeda4 100644 --- a/folly/Exception.h +++ b/folly/Exception.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXCEPTION_H_ -#define FOLLY_EXCEPTION_H_ +#pragma once #include @@ -119,5 +118,3 @@ void throwOnFail(V&& value, Args&&... args) { ::folly::throwOnFail((cond), "Check failed: " #cond) } // namespace folly - -#endif /* FOLLY_EXCEPTION_H_ */ diff --git a/folly/ExceptionWrapper.h b/folly/ExceptionWrapper.h index 39eceda4..22857a0b 100644 --- a/folly/ExceptionWrapper.h +++ b/folly/ExceptionWrapper.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXCEPTIONWRAPPER_H -#define FOLLY_EXCEPTIONWRAPPER_H +#pragma once #include #include @@ -468,4 +467,3 @@ class try_and_catch<> : public exception_wrapper { } }; } -#endif diff --git a/folly/FBString.h b/folly/FBString.h index 2f025154..81f146dd 100644 --- a/folly/FBString.h +++ b/folly/FBString.h @@ -17,8 +17,7 @@ // @author: Andrei Alexandrescu (aalexandre) // String type. -#ifndef FOLLY_BASE_FBSTRING_H_ -#define FOLLY_BASE_FBSTRING_H_ +#pragma once #include #include @@ -2492,5 +2491,3 @@ FOLLY_FBSTRING_HASH #undef NDEBUG #undef FOLLY_DEFINED_NDEBUG_FOR_FBSTRING #endif // FOLLY_DEFINED_NDEBUG_FOR_FBSTRING - -#endif // FOLLY_BASE_FBSTRING_H_ diff --git a/folly/FBVector.h b/folly/FBVector.h index c44defef..e1809f31 100644 --- a/folly/FBVector.h +++ b/folly/FBVector.h @@ -22,8 +22,7 @@ * optimizations for use with relocatable types and jemalloc. */ -#ifndef FOLLY_FBVECTOR_H -#define FOLLY_FBVECTOR_H +#pragma once //============================================================================= // headers @@ -1659,5 +1658,3 @@ void attach(fbvector& v, T* data, size_t sz, size_t cap) { } } // namespace folly - -#endif // FOLLY_FBVECTOR_H diff --git a/folly/File.h b/folly/File.h index 53e58def..09a3b6bf 100644 --- a/folly/File.h +++ b/folly/File.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_FILE_H_ -#define FOLLY_FILE_H_ +#pragma once #include #include @@ -136,5 +135,3 @@ void swap(File& a, File& b); } // namespace folly - -#endif /* FOLLY_FILE_H_ */ diff --git a/folly/FileUtil.h b/folly/FileUtil.h index 31d368b0..a28b0477 100644 --- a/folly/FileUtil.h +++ b/folly/FileUtil.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_FILEUTIL_H_ -#define FOLLY_FILEUTIL_H_ +#pragma once #include #include @@ -193,5 +192,3 @@ bool writeFile(const Container& data, const char* filename, } } // namespaces - -#endif /* FOLLY_FILEUTIL_H_ */ diff --git a/folly/Fingerprint.h b/folly/Fingerprint.h index c4f6978d..f1980ae2 100644 --- a/folly/Fingerprint.h +++ b/folly/Fingerprint.h @@ -42,8 +42,7 @@ * @author Tudor Bosman (tudorb@facebook.com) */ -#ifndef FOLLY_FINGERPRINT_H_ -#define FOLLY_FINGERPRINT_H_ +#pragma once #include @@ -261,5 +260,3 @@ inline uint64_t Fingerprint<128>::shlor64(uint64_t v) { } } // namespace folly - -#endif /* FOLLY_FINGERPRINT_H_ */ diff --git a/folly/Foreach.h b/folly/Foreach.h index c6e45835..d362c0ba 100644 --- a/folly/Foreach.h +++ b/folly/Foreach.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_BASE_FOREACH_H_ -#define FOLLY_BASE_FOREACH_H_ +#pragma once /* * Iterim macros (until we have C++0x range-based for) that simplify @@ -227,5 +226,3 @@ downTo(T& iter, const U& begin) { */ #define FOR_EACH_RANGE_R(i, begin, end) \ for (auto i = (false ? (begin) : (end)); ::folly::detail::downTo(i, (begin));) - -#endif diff --git a/folly/Format.h b/folly/Format.h index 89332a1b..c34f3339 100644 --- a/folly/Format.h +++ b/folly/Format.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_FORMAT_H_ +#pragma once #define FOLLY_FORMAT_H_ #include @@ -433,5 +433,3 @@ vformatChecked(Str* out, StringPiece fmt, Container&& container) { #include #pragma GCC diagnostic pop - -#endif /* FOLLY_FORMAT_H_ */ diff --git a/folly/FormatArg.h b/folly/FormatArg.h index 127745c4..6f25299e 100644 --- a/folly/FormatArg.h +++ b/folly/FormatArg.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_FORMATARG_H_ -#define FOLLY_FORMATARG_H_ +#pragma once #include #include @@ -275,5 +274,3 @@ inline int FormatArg::splitIntKey() { } } // namespace folly - -#endif /* FOLLY_FORMATARG_H_ */ diff --git a/folly/FormatTraits.h b/folly/FormatTraits.h index 9ff17bd6..54175da4 100644 --- a/folly/FormatTraits.h +++ b/folly/FormatTraits.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_FORMAT_TRAITS_H_ -#define FOLLY_FORMAT_TRAITS_H_ +#pragma once #include @@ -62,5 +61,3 @@ struct IndexableTraitsAssoc : public FormatTraitsBase { }; }} // namespaces - -#endif /* FOLLY_FORMAT_TRAITS_H_ */ diff --git a/folly/GroupVarint.h b/folly/GroupVarint.h index 136a7b17..f91191ce 100644 --- a/folly/GroupVarint.h +++ b/folly/GroupVarint.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GROUPVARINT_H_ -#define FOLLY_GROUPVARINT_H_ +#pragma once #if !defined(__GNUC__) && !defined(_MSC_VER) #error GroupVarint.h requires GCC or MSVC @@ -618,4 +617,3 @@ typedef GroupVarintDecoder GroupVarint64Decoder; } // namespace folly #endif /* FOLLY_X64 || defined(__i386__) || FOLLY_PPC64 */ -#endif /* FOLLY_GROUPVARINT_H_ */ diff --git a/folly/Hash.h b/folly/Hash.h index 77f01a96..dd61fb76 100644 --- a/folly/Hash.h +++ b/folly/Hash.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_BASE_HASH_H_ -#define FOLLY_BASE_HASH_H_ +#pragma once #include #include @@ -460,5 +459,3 @@ namespace std { } }; } // namespace std - -#endif diff --git a/folly/IndexedMemPool.h b/folly/IndexedMemPool.h index f8771f33..1007eff9 100644 --- a/folly/IndexedMemPool.h +++ b/folly/IndexedMemPool.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_INDEXEDMEMPOOL_H -#define FOLLY_INDEXEDMEMPOOL_H +#pragma once #include #include @@ -466,4 +465,3 @@ struct IndexedMemPoolRecycler { } // namespace folly # pragma GCC diagnostic pop -#endif diff --git a/folly/IntrusiveList.h b/folly/IntrusiveList.h index 8d48c2aa..5a670e72 100644 --- a/folly/IntrusiveList.h +++ b/folly/IntrusiveList.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_INTRUSIVELIST_H_ -#define FOLLY_INTRUSIVELIST_H_ +#pragma once /* * This file contains convenience aliases that make boost::intrusive::list @@ -117,5 +116,3 @@ using CountedIntrusiveList = boost::intrusive::list< boost::intrusive::constant_time_size>; } // folly - -#endif // FOLLY_INTRUSIVELIST_H_ diff --git a/folly/Lazy.h b/folly/Lazy.h index 0edb2e77..1d1ba728 100644 --- a/folly/Lazy.h +++ b/folly/Lazy.h @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef FOLLY_LAZY_H_ -#define FOLLY_LAZY_H_ + +#pragma once #include #include @@ -131,5 +131,3 @@ lazy(Func&& fun) { ////////////////////////////////////////////////////////////////////// } - -#endif diff --git a/folly/LifoSem.h b/folly/LifoSem.h index 32358fcb..e5a06a92 100644 --- a/folly/LifoSem.h +++ b/folly/LifoSem.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_LIFOSEM_H -#define FOLLY_LIFOSEM_H +#pragma once #include #include @@ -605,5 +604,3 @@ struct LifoSemImpl : public detail::LifoSemBase { }; } // namespace folly - -#endif diff --git a/folly/Likely.h b/folly/Likely.h index 0888ab7a..9a5aea99 100644 --- a/folly/Likely.h +++ b/folly/Likely.h @@ -21,8 +21,7 @@ * @author Tudor Bosman (tudorb@fb.com) */ -#ifndef FOLLY_BASE_LIKELY_H_ -#define FOLLY_BASE_LIKELY_H_ +#pragma once #undef LIKELY #undef UNLIKELY @@ -34,5 +33,3 @@ #define LIKELY(x) (x) #define UNLIKELY(x) (x) #endif - -#endif /* FOLLY_BASE_LIKELY_H_ */ diff --git a/folly/Logging.h b/folly/Logging.h index f99b5030..404ca80e 100644 --- a/folly/Logging.h +++ b/folly/Logging.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_LOGGING_H_ -#define FOLLY_LOGGING_H_ +#pragma once #include #include @@ -54,5 +53,3 @@ LOG(severity) #endif - -#endif // FOLLY_LOGGING_H_ diff --git a/folly/Malloc.h b/folly/Malloc.h index 87d34ab4..e7616da5 100644 --- a/folly/Malloc.h +++ b/folly/Malloc.h @@ -17,7 +17,7 @@ // Functions to provide smarter use of jemalloc, if jemalloc is being used. // http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html -#ifndef FOLLY_MALLOC_H_ +#pragma once #define FOLLY_MALLOC_H_ /** @@ -279,5 +279,3 @@ _GLIBCXX_END_NAMESPACE_VERSION } // folly #endif // !defined(_GLIBCXX_USE_FB) || defined(_LIBSTDCXX_FBSTRING) - -#endif // FOLLY_MALLOC_H_ diff --git a/folly/MapUtil.h b/folly/MapUtil.h index d1094f51..0df5d788 100644 --- a/folly/MapUtil.h +++ b/folly/MapUtil.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_MAPUTIL_H_ -#define FOLLY_MAPUTIL_H_ +#pragma once #include #include @@ -100,5 +99,3 @@ typename Map::mapped_type* get_ptr( } } // namespace folly - -#endif /* FOLLY_MAPUTIL_H_ */ diff --git a/folly/Memory.h b/folly/Memory.h index 69af41d1..193d5062 100644 --- a/folly/Memory.h +++ b/folly/Memory.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_MEMORY_H_ -#define FOLLY_MEMORY_H_ +#pragma once #include #include @@ -418,5 +417,3 @@ std::shared_ptr allocate_shared(Allocator&& allocator, Args&&... args) { template struct IsArenaAllocator : std::false_type { }; } // namespace folly - -#endif /* FOLLY_MEMORY_H_ */ diff --git a/folly/MemoryMapping.h b/folly/MemoryMapping.h index 0b9bce9f..bc114d89 100644 --- a/folly/MemoryMapping.h +++ b/folly/MemoryMapping.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_MEMORYMAPPING_H_ -#define FOLLY_MEMORYMAPPING_H_ +#pragma once #include #include @@ -250,5 +249,3 @@ void alignedForwardMemcpy(void* dest, const void* src, size_t size); void mmapFileCopy(const char* src, const char* dest, mode_t mode = 0666); } // namespace folly - -#endif /* FOLLY_MEMORYMAPPING_H_ */ diff --git a/folly/Merge.h b/folly/Merge.h index 775d989b..51af2f82 100644 --- a/folly/Merge.h +++ b/folly/Merge.h @@ -36,8 +36,7 @@ * from a. */ -#ifndef FOLLY_MERGE_H_ -#define FOLLY_MERGE_H_ +#pragma once #include @@ -82,5 +81,3 @@ OutputIt merge(InputIt1 first1, InputIt1 last1, } } - -#endif diff --git a/folly/Optional.h b/folly/Optional.h index 2e04e332..6fc07b98 100644 --- a/folly/Optional.h +++ b/folly/Optional.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_OPTIONAL_H_ -#define FOLLY_OPTIONAL_H_ +#pragma once /* * Optional - For conditional initialization of values, like boost::optional, @@ -406,5 +405,3 @@ template bool operator> (const V& other, const Optional&) = delete; /////////////////////////////////////////////////////////////////////////////// } // namespace folly - -#endif // FOLLY_OPTIONAL_H_ diff --git a/folly/PackedSyncPtr.h b/folly/PackedSyncPtr.h index fd7424c5..74c5ab8f 100644 --- a/folly/PackedSyncPtr.h +++ b/folly/PackedSyncPtr.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_PACKEDSYNCPTR_H_ -#define FOLLY_PACKEDSYNCPTR_H_ +#pragma once #include @@ -147,5 +146,3 @@ static_assert(sizeof(PackedSyncPtr) == 8, "messed up"); } - -#endif diff --git a/folly/Padded.h b/folly/Padded.h index 94fc1103..d474b850 100644 --- a/folly/Padded.h +++ b/folly/Padded.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_PADDED_H_ -#define FOLLY_PADDED_H_ +#pragma once #include #include @@ -512,5 +511,3 @@ class Adaptor { } // namespace padded } // namespace folly - -#endif /* FOLLY_PADDED_H_ */ diff --git a/folly/Portability.h b/folly/Portability.h index 7de1d8de..c9616ea7 100644 --- a/folly/Portability.h +++ b/folly/Portability.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_PORTABILITY_H_ -#define FOLLY_PORTABILITY_H_ +#pragma once #include @@ -365,5 +364,3 @@ using namespace FOLLY_GFLAGS_NAMESPACE; // we will take the next one. #define FOLLY_STATIC_CTOR_PRIORITY_MAX __attribute__((__init_priority__(102))) #endif - -#endif // FOLLY_PORTABILITY_H_ diff --git a/folly/Preprocessor.h b/folly/Preprocessor.h index 49bbc710..9d098c3d 100644 --- a/folly/Preprocessor.h +++ b/folly/Preprocessor.h @@ -16,8 +16,7 @@ // @author: Andrei Alexandrescu -#ifndef FOLLY_PREPROCESSOR_ -#define FOLLY_PREPROCESSOR_ +#pragma once /** * Necessarily evil preprocessor-related amenities. @@ -92,5 +91,3 @@ * another macro expansion. */ #define FB_STRINGIZE(x) #x - -#endif // FOLLY_PREPROCESSOR_ diff --git a/folly/ProducerConsumerQueue.h b/folly/ProducerConsumerQueue.h index 69f3fd5a..da9b93a4 100644 --- a/folly/ProducerConsumerQueue.h +++ b/folly/ProducerConsumerQueue.h @@ -17,8 +17,7 @@ // @author Bo Hu (bhu@fb.com) // @author Jordan DeLong (delong.j@fb.com) -#ifndef PRODUCER_CONSUMER_QUEUE_H_ -#define PRODUCER_CONSUMER_QUEUE_H_ +#pragma once #include #include @@ -174,5 +173,3 @@ private: }; } - -#endif diff --git a/folly/RWSpinLock.h b/folly/RWSpinLock.h index a5b60534..5bbdca6f 100644 --- a/folly/RWSpinLock.h +++ b/folly/RWSpinLock.h @@ -81,8 +81,7 @@ * @author Xin Liu */ -#ifndef FOLLY_RWSPINLOCK_H_ -#define FOLLY_RWSPINLOCK_H_ +#pragma once /* ======================================================================== @@ -787,5 +786,3 @@ typedef RWTicketSpinLockT<64> RWTicketSpinLock64; #ifdef RW_SPINLOCK_USE_X86_INTRINSIC_ #undef RW_SPINLOCK_USE_X86_INTRINSIC_ #endif - -#endif // FOLLY_RWSPINLOCK_H_ diff --git a/folly/Random.h b/folly/Random.h index 53283a28..0cfc5efe 100644 --- a/folly/Random.h +++ b/folly/Random.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_RANDOM_H_ +#pragma once #define FOLLY_RANDOM_H_ #include @@ -245,5 +245,3 @@ inline uint32_t randomNumberSeed() { } #include - -#endif diff --git a/folly/Range.h b/folly/Range.h index 4913aef4..db2de699 100644 --- a/folly/Range.h +++ b/folly/Range.h @@ -17,8 +17,7 @@ // @author Mark Rabkin (mrabkin@fb.com) // @author Andrei Alexandrescu (andrei.alexandrescu@fb.com) -#ifndef FOLLY_RANGE_H_ -#define FOLLY_RANGE_H_ +#pragma once #include #include @@ -1147,5 +1146,3 @@ struct hasher, #pragma GCC diagnostic pop FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(folly::Range); - -#endif // FOLLY_RANGE_H_ diff --git a/folly/SafeAssert.h b/folly/SafeAssert.h index 65d2e9f9..39d07423 100644 --- a/folly/SafeAssert.h +++ b/folly/SafeAssert.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SAFEASSERT_H_ -#define FOLLY_SAFEASSERT_H_ +#pragma once #include #include @@ -50,5 +49,3 @@ namespace folly { namespace detail { unsigned int line, const char* function); }} // namespace folly - -#endif /* FOLLY_SAFEASSERT_H_ */ diff --git a/folly/ScopeGuard.h b/folly/ScopeGuard.h index 8b16fae1..0e2ac6d1 100644 --- a/folly/ScopeGuard.h +++ b/folly/ScopeGuard.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SCOPEGUARD_H_ -#define FOLLY_SCOPEGUARD_H_ +#pragma once #include #include @@ -276,5 +275,3 @@ operator+(detail::ScopeGuardOnExit, FunctionType&& fn) { auto FB_ANONYMOUS_VARIABLE(SCOPE_SUCCESS_STATE) \ = ::folly::detail::ScopeGuardOnSuccess() + [&]() #endif // native uncaught_exception() supported - -#endif // FOLLY_SCOPEGUARD_H_ diff --git a/folly/SmallLocks.h b/folly/SmallLocks.h index 88fefe3e..fe447563 100644 --- a/folly/SmallLocks.h +++ b/folly/SmallLocks.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SMALLLOCKS_H_ -#define FOLLY_SMALLLOCKS_H_ +#pragma once /* * This header defines a few very small mutex types. These are useful @@ -41,5 +40,3 @@ #if FOLLY_X64 || FOLLY_A64 || FOLLY_PPC64 #include #endif - -#endif diff --git a/folly/SparseByteSet.h b/folly/SparseByteSet.h index bed95095..2dc55e87 100644 --- a/folly/SparseByteSet.h +++ b/folly/SparseByteSet.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_FAST_BYTE_SET_H_ -#define FOLLY_FAST_BYTE_SET_H_ +#pragma once #include #include @@ -86,5 +85,3 @@ class SparseByteSet { }; } - -#endif diff --git a/folly/SpookyHashV1.h b/folly/SpookyHashV1.h index d6c55539..2a3d8670 100644 --- a/folly/SpookyHashV1.h +++ b/folly/SpookyHashV1.h @@ -42,8 +42,7 @@ // slower than MD5. // -#ifndef FOLLY_SPOOKYHASHV1_H_ -#define FOLLY_SPOOKYHASHV1_H_ +#pragma once #include #include @@ -302,5 +301,3 @@ private: } // namespace hash } // namespace folly - -#endif diff --git a/folly/SpookyHashV2.h b/folly/SpookyHashV2.h index 7344ec27..804191d1 100644 --- a/folly/SpookyHashV2.h +++ b/folly/SpookyHashV2.h @@ -43,8 +43,7 @@ // slower than MD5. // -#ifndef FOLLY_SPOOKYHASHV2_H_ -#define FOLLY_SPOOKYHASHV2_H_ +#pragma once #include #include @@ -307,5 +306,3 @@ private: } // namespace hash } // namespace folly - -#endif diff --git a/folly/String-inl.h b/folly/String-inl.h index 114292d2..e3ad12b4 100644 --- a/folly/String-inl.h +++ b/folly/String-inl.h @@ -14,13 +14,12 @@ * limitations under the License. */ -#ifndef FOLLY_STRING_INL_H_ -#define FOLLY_STRING_INL_H_ +#pragma once #include #include -#ifndef FOLLY_BASE_STRING_H_ +#ifndef FOLLY_STRING_H_ #error This file may only be included from String.h #endif @@ -669,5 +668,3 @@ void hexDump(const void* ptr, size_t size, OutIt out) { } } // namespace folly - -#endif /* FOLLY_STRING_INL_H_ */ diff --git a/folly/String.h b/folly/String.h index 19a2c3b2..5a5763ca 100644 --- a/folly/String.h +++ b/folly/String.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FOLLY_BASE_STRING_H_ -#define FOLLY_BASE_STRING_H_ +#pragma once +#define FOLLY_STRING_H_ #include #include @@ -628,5 +628,3 @@ struct has_nothrow_constructor > : true_type { } // namespace boost #include - -#endif diff --git a/folly/Subprocess.h b/folly/Subprocess.h index 22583e84..c70a1f4b 100644 --- a/folly/Subprocess.h +++ b/folly/Subprocess.h @@ -90,8 +90,8 @@ * make sure to serialize your signals (i.e. kill()) with the waits -- * either wait & signal from the same thread, or use a mutex. */ -#ifndef FOLLY_SUBPROCESS_H_ -#define FOLLY_SUBPROCESS_H_ + +#pragma once #include #include @@ -869,5 +869,3 @@ inline Subprocess::Options& Subprocess::Options::operator|=( } } // namespace folly - -#endif /* FOLLY_SUBPROCESS_H_ */ diff --git a/folly/Synchronized.h b/folly/Synchronized.h index d10a97fc..5ea2ad54 100644 --- a/folly/Synchronized.h +++ b/folly/Synchronized.h @@ -21,8 +21,7 @@ * @author: Andrei Alexandrescu (andrei.alexandrescu@fb.com) */ -#ifndef SYNCHRONIZED_H_ -#define SYNCHRONIZED_H_ +#pragma once #include #include @@ -762,5 +761,3 @@ void lockInOrder(P1& p1, P2& p2) { else } /* namespace folly */ - -#endif // SYNCHRONIZED_H_ diff --git a/folly/ThreadCachedArena.h b/folly/ThreadCachedArena.h index 50085aec..1fafe3f9 100644 --- a/folly/ThreadCachedArena.h +++ b/folly/ThreadCachedArena.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_THREADCACHEDARENA_H_ -#define FOLLY_THREADCACHEDARENA_H_ +#pragma once #include @@ -86,5 +85,3 @@ template <> struct IsArenaAllocator : std::true_type { }; } // namespace folly - -#endif /* FOLLY_THREADCACHEDARENA_H_ */ diff --git a/folly/ThreadCachedInt.h b/folly/ThreadCachedInt.h index 7e16d6a7..fcc4a7ea 100644 --- a/folly/ThreadCachedInt.h +++ b/folly/ThreadCachedInt.h @@ -20,8 +20,7 @@ * @author Spencer Ahrens (sahrens) */ -#ifndef FOLLY_THREADCACHEDINT_H -#define FOLLY_THREADCACHEDINT_H +#pragma once #include @@ -175,5 +174,3 @@ class ThreadCachedInt : boost::noncopyable { }; } - -#endif diff --git a/folly/ThreadLocal.h b/folly/ThreadLocal.h index 30b8042b..abc9b64a 100644 --- a/folly/ThreadLocal.h +++ b/folly/ThreadLocal.h @@ -34,8 +34,7 @@ * @author Spencer Ahrens (sahrens) */ -#ifndef FOLLY_THREADLOCAL_H_ -#define FOLLY_THREADLOCAL_H_ +#pragma once #include #include @@ -353,5 +352,3 @@ class ThreadLocalPtr { }; } // namespace folly - -#endif /* FOLLY_THREADLOCAL_H_ */ diff --git a/folly/TimeoutQueue.h b/folly/TimeoutQueue.h index bbf556ca..cef83a9b 100644 --- a/folly/TimeoutQueue.h +++ b/folly/TimeoutQueue.h @@ -25,8 +25,7 @@ * @author Tudor Bosman (tudorb@fb.com) */ -#ifndef FOLLY_TIMEOUTQUEUE_H_ -#define FOLLY_TIMEOUTQUEUE_H_ +#pragma once #include #include @@ -127,5 +126,3 @@ class TimeoutQueue { }; } // namespace folly - -#endif /* FOLLY_TIMEOUTQUEUE_H_ */ diff --git a/folly/Traits.h b/folly/Traits.h index 2d8c52dd..f34dc748 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -16,8 +16,7 @@ // @author: Andrei Alexandrescu -#ifndef FOLLY_BASE_TRAITS_H_ -#define FOLLY_BASE_TRAITS_H_ +#pragma once #include #include @@ -481,5 +480,3 @@ FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(boost::shared_ptr); classname, func_name, /* nolint */ volatile); \ FOLLY_CREATE_HAS_MEMBER_FN_TRAITS_IMPL( \ classname, func_name, /* nolint */ volatile const) - -#endif //FOLLY_BASE_TRAITS_H_ diff --git a/folly/Unicode.h b/folly/Unicode.h index d07cf310..ecd0ae10 100644 --- a/folly/Unicode.h +++ b/folly/Unicode.h @@ -16,8 +16,7 @@ // Some utility routines relating to unicode. -#ifndef FOLLY_UNICODE_H_ -#define FOLLY_UNICODE_H_ +#pragma once #include @@ -35,5 +34,3 @@ fbstring codePointToUtf8(char32_t cp); ////////////////////////////////////////////////////////////////////// } - -#endif diff --git a/folly/Uri.h b/folly/Uri.h index de693baa..fe88523d 100644 --- a/folly/Uri.h +++ b/folly/Uri.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_URI_H_ +#pragma once #define FOLLY_URI_H_ #include @@ -119,5 +119,3 @@ class Uri { } // namespace folly #include - -#endif /* FOLLY_URI_H_ */ diff --git a/folly/Varint.h b/folly/Varint.h index a9b9d0d6..d2e661eb 100644 --- a/folly/Varint.h +++ b/folly/Varint.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_VARINT_H_ -#define FOLLY_VARINT_H_ +#pragma once #include #include @@ -138,5 +137,3 @@ inline uint64_t decodeVarint(Range& data) { } } // namespaces - -#endif /* FOLLY_VARINT_H_ */ diff --git a/folly/VersionCheck.h b/folly/VersionCheck.h index c864e7db..9a3ce677 100644 --- a/folly/VersionCheck.h +++ b/folly/VersionCheck.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_VERSIONCHECK_H_ -#define FOLLY_VERSIONCHECK_H_ +#pragma once #include #include @@ -107,5 +106,3 @@ } \ } \ } - -#endif /* FOLLY_VERSIONCHECK_H_ */ diff --git a/folly/detail/AtomicHashUtils.h b/folly/detail/AtomicHashUtils.h index bb49eef0..ba1f49a5 100644 --- a/folly/detail/AtomicHashUtils.h +++ b/folly/detail/AtomicHashUtils.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef incl_FOLLY_ATOMIC_HASH_UTILS_H -#define incl_FOLLY_ATOMIC_HASH_UTILS_H +#pragma once #include #include @@ -38,5 +37,3 @@ void atomic_hash_spin_wait(Cond condition) { } }} // namespace folly::detail - -#endif diff --git a/folly/detail/BitIteratorDetail.h b/folly/detail/BitIteratorDetail.h index e8a0b38d..6a8b4fe6 100644 --- a/folly/detail/BitIteratorDetail.h +++ b/folly/detail/BitIteratorDetail.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_BITITERATORDETAIL_H_ -#define FOLLY_DETAIL_BITITERATORDETAIL_H_ +#pragma once #include #include @@ -88,5 +87,3 @@ struct BitIteratorBase { } // namespace bititerator_detail } // namespace folly - -#endif /* FOLLY_DETAIL_BITITERATORDETAIL_H_ */ diff --git a/folly/detail/BitsDetail.h b/folly/detail/BitsDetail.h index a411d0a9..d89a25ef 100644 --- a/folly/detail/BitsDetail.h +++ b/folly/detail/BitsDetail.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_BITSDETAIL_H_ -#define FOLLY_DETAIL_BITSDETAIL_H_ +#pragma once namespace folly { namespace detail { @@ -49,5 +48,3 @@ int popcountll(unsigned long long x); } // namespace detail } // namespace folly - -#endif /* FOLLY_DETAIL_BITSDETAIL_H_ */ diff --git a/folly/detail/CacheLocality.h b/folly/detail/CacheLocality.h index db29b1bd..1ede43cb 100644 --- a/folly/detail/CacheLocality.h +++ b/folly/detail/CacheLocality.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_CACHELOCALITY_H_ -#define FOLLY_DETAIL_CACHELOCALITY_H_ +#pragma once #include #include @@ -346,5 +345,3 @@ Getcpu::Func AccessSpreader::pickGetcpuFunc(); } // namespace detail } // namespace folly - -#endif /* FOLLY_DETAIL_CacheLocality_H_ */ diff --git a/folly/detail/ChecksumDetail.h b/folly/detail/ChecksumDetail.h index 9bbe22e9..540b3201 100644 --- a/folly/detail/ChecksumDetail.h +++ b/folly/detail/ChecksumDetail.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_CHECKSUMDETAIL_H_ -#define FOLLY_DETAIL_CHECKSUMDETAIL_H_ +#pragma once namespace folly { namespace detail { @@ -54,5 +53,3 @@ uint32_t crc32c_sw(const uint8_t* data, size_t nbytes, }} // folly::detail - -#endif /* FOLLY_DETAIL_CHECKSUMDETAIL_H_ */ diff --git a/folly/detail/DiscriminatedPtrDetail.h b/folly/detail/DiscriminatedPtrDetail.h index 2c14642d..8795321a 100644 --- a/folly/detail/DiscriminatedPtrDetail.h +++ b/folly/detail/DiscriminatedPtrDetail.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_DISCRIMINATEDPTRDETAIL_H_ -#define FOLLY_DETAIL_DISCRIMINATEDPTRDETAIL_H_ +#pragma once #include #include @@ -161,5 +160,3 @@ struct ApplyConstVisitor } // namespace dptr_detail } // namespace folly - -#endif /* FOLLY_DETAIL_DISCRIMINATEDPTRDETAIL_H_ */ diff --git a/folly/detail/ExceptionWrapper.h b/folly/detail/ExceptionWrapper.h index c38b8c75..8d5071a6 100644 --- a/folly/detail/ExceptionWrapper.h +++ b/folly/detail/ExceptionWrapper.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_EXCEPTIONWRAPPER_H -#define FOLLY_DETAIL_EXCEPTIONWRAPPER_H +#pragma once namespace folly { namespace detail { @@ -28,5 +27,3 @@ class Thrower { }; }} - -#endif diff --git a/folly/detail/FileUtilDetail.h b/folly/detail/FileUtilDetail.h index 11f06ae4..b5ae6f65 100644 --- a/folly/detail/FileUtilDetail.h +++ b/folly/detail/FileUtilDetail.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_FILEUTILDETAIL_H_ -#define FOLLY_DETAIL_FILEUTILDETAIL_H_ +#pragma once #include #include @@ -107,5 +106,3 @@ ssize_t wrapvFull(F f, int fd, iovec* iov, int count, Offset... offset) { } }} // namespaces - -#endif /* FOLLY_DETAIL_FILEUTILDETAIL_H_ */ diff --git a/folly/detail/FingerprintPolynomial.h b/folly/detail/FingerprintPolynomial.h index f405fd83..588ae757 100644 --- a/folly/detail/FingerprintPolynomial.h +++ b/folly/detail/FingerprintPolynomial.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_BUILD_FINGERPRINTPOLYNOMIAL_H_ -#define FOLLY_BUILD_FINGERPRINTPOLYNOMIAL_H_ +#pragma once #include @@ -141,5 +140,3 @@ class FingerprintPolynomial { } // namespace detail } // namespace folly - -#endif /* FOLLY_BUILD_FINGERPRINTPOLYNOMIAL_H_ */ diff --git a/folly/detail/FunctionalExcept.h b/folly/detail/FunctionalExcept.h index 575da6f3..643c8eb2 100644 --- a/folly/detail/FunctionalExcept.h +++ b/folly/detail/FunctionalExcept.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_FUNCTIONAL_EXCEPT_H -#define FOLLY_DETAIL_FUNCTIONAL_EXCEPT_H +#pragma once #include @@ -36,5 +35,3 @@ FOLLY_NAMESPACE_STD_END #else #error This file should never be included if FOLLY_HAVE_BITS_FUNCTEXCEPT_H is set #endif - -#endif diff --git a/folly/detail/GroupVarintDetail.h b/folly/detail/GroupVarintDetail.h index f5c68c7e..d44e7995 100644 --- a/folly/detail/GroupVarintDetail.h +++ b/folly/detail/GroupVarintDetail.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_GROUPVARINTDETAIL_H_ -#define FOLLY_DETAIL_GROUPVARINTDETAIL_H_ +#pragma once #include @@ -99,5 +98,3 @@ class GroupVarintBase { } // namespace detail } // namespace folly - -#endif /* FOLLY_DETAIL_GROUPVARINTDETAIL_H_ */ diff --git a/folly/detail/Malloc.h b/folly/detail/Malloc.h index 1136c832..4a7fa73b 100644 --- a/folly/detail/Malloc.h +++ b/folly/detail/Malloc.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_MALLOC_H -#define FOLLY_DETAIL_MALLOC_H +#pragma once #include @@ -84,5 +83,3 @@ extern int (*mallctlbymib)(const size_t*, size_t, void*, size_t*, void*, #endif } - -#endif diff --git a/folly/detail/MemoryIdler.h b/folly/detail/MemoryIdler.h index 4b11c720..e4bebc34 100644 --- a/folly/detail/MemoryIdler.h +++ b/folly/detail/MemoryIdler.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_MEMORYIDLER_H -#define FOLLY_DETAIL_MEMORYIDLER_H +#pragma once #include #include @@ -149,5 +148,3 @@ struct MemoryIdler { }; }} // namespace folly::detail - -#endif diff --git a/folly/detail/RangeCommon.h b/folly/detail/RangeCommon.h index 9e670046..f7c8a4a5 100644 --- a/folly/detail/RangeCommon.h +++ b/folly/detail/RangeCommon.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_RANGE_COMMON_H_ -#define FOLLY_DETAIL_RANGE_COMMON_H_ +#pragma once #include #include @@ -86,5 +85,3 @@ inline size_t qfind_first_byte_of_nosse(const StringPieceLite haystack, } } - -#endif diff --git a/folly/detail/RangeSse42.h b/folly/detail/RangeSse42.h index 142f057d..e0578202 100644 --- a/folly/detail/RangeSse42.h +++ b/folly/detail/RangeSse42.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_RANGE_SSE42_H_ -#define FOLLY_DETAIL_RANGE_SSE42_H_ +#pragma once #include #include @@ -30,5 +29,3 @@ size_t qfind_first_byte_of_sse42(const StringPieceLite haystack, } } - -#endif diff --git a/folly/detail/SlowFingerprint.h b/folly/detail/SlowFingerprint.h index 73e19252..1bbbda61 100644 --- a/folly/detail/SlowFingerprint.h +++ b/folly/detail/SlowFingerprint.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_SLOWFINGERPRINT_H_ -#define FOLLY_DETAIL_SLOWFINGERPRINT_H_ +#pragma once #include #include @@ -88,5 +87,3 @@ class SlowFingerprint { } // namespace detail } // namespace folly - -#endif /* FOLLY_DETAIL_SLOWFINGERPRINT_H_ */ diff --git a/folly/detail/Stats.h b/folly/detail/Stats.h index 5d960664..1620cb5d 100644 --- a/folly/detail/Stats.h +++ b/folly/detail/Stats.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_STATS_H_ -#define FOLLY_DETAIL_STATS_H_ +#pragma once #include #include @@ -123,5 +122,3 @@ struct Bucket { }; }} // folly::detail - -#endif // FOLLY_DETAIL_STATS_H_ diff --git a/folly/detail/ThreadLocalDetail.h b/folly/detail/ThreadLocalDetail.h index 57d1767e..23c566f0 100644 --- a/folly/detail/ThreadLocalDetail.h +++ b/folly/detail/ThreadLocalDetail.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_THREADLOCALDETAIL_H_ -#define FOLLY_DETAIL_THREADLOCALDETAIL_H_ +#pragma once #include #include @@ -359,5 +358,3 @@ struct StaticMeta : StaticMetaBase { } // namespace threadlocal_detail } // namespace folly - -#endif /* FOLLY_DETAIL_THREADLOCALDETAIL_H_ */ diff --git a/folly/detail/UncaughtExceptionCounter.h b/folly/detail/UncaughtExceptionCounter.h index b0119c06..0fb76c7a 100644 --- a/folly/detail/UncaughtExceptionCounter.h +++ b/folly/detail/UncaughtExceptionCounter.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DETAIL_UNCAUGHTEXCEPTIONCOUNTER_H_ -#define FOLLY_DETAIL_UNCAUGHTEXCEPTIONCOUNTER_H_ +#pragma once #include @@ -93,5 +92,3 @@ inline int UncaughtExceptionCounter::getUncaughtExceptionCount() noexcept { } }} // namespaces - -#endif /* FOLLY_DETAIL_UNCAUGHTEXCEPTIONCOUNTER_H_ */ diff --git a/folly/dynamic-inl.h b/folly/dynamic-inl.h index cea7f283..b357d3ee 100644 --- a/folly/dynamic-inl.h +++ b/folly/dynamic-inl.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_DYNAMIC_INL_H_ -#define FOLLY_DYNAMIC_INL_H_ +#pragma once #include #include @@ -874,5 +873,3 @@ class FormatValue> { } // namespaces #undef FB_DYNAMIC_APPLY - -#endif diff --git a/folly/dynamic.h b/folly/dynamic.h index ef4fdf68..c2ab2a4b 100644 --- a/folly/dynamic.h +++ b/folly/dynamic.h @@ -60,8 +60,7 @@ * @author Jordan DeLong */ -#ifndef FOLLY_DYNAMIC_H_ -#define FOLLY_DYNAMIC_H_ +#pragma once #include #include @@ -588,5 +587,3 @@ private: } #include - -#endif diff --git a/folly/experimental/BitVectorCoding.h b/folly/experimental/BitVectorCoding.h index 7dcd3340..738e820a 100644 --- a/folly/experimental/BitVectorCoding.h +++ b/folly/experimental/BitVectorCoding.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXPERIMENTAL_BIT_VECTOR_CODING_H -#define FOLLY_EXPERIMENTAL_BIT_VECTOR_CODING_H +#pragma once #include #include @@ -448,5 +447,3 @@ class BitVectorReader { }; }} // namespaces - -#endif // FOLLY_EXPERIMENTAL_BIT_VECTOR_CODING_H diff --git a/folly/experimental/Bits.h b/folly/experimental/Bits.h index 19c1de28..50836ed8 100644 --- a/folly/experimental/Bits.h +++ b/folly/experimental/Bits.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXPERIMENTAL_BITS_H_ -#define FOLLY_EXPERIMENTAL_BITS_H_ +#pragma once #include #include @@ -304,5 +303,3 @@ inline size_t Bits::count(const T* begin, const T* end) { } } // namespace folly - -#endif /* FOLLY_EXPERIMENTAL_BITS_H_ */ diff --git a/folly/experimental/EliasFanoCoding.h b/folly/experimental/EliasFanoCoding.h index c586a6d5..9f3b8744 100644 --- a/folly/experimental/EliasFanoCoding.h +++ b/folly/experimental/EliasFanoCoding.h @@ -21,8 +21,7 @@ * "Quasi-succinct indices" (arxiv:1206.4300). */ -#ifndef FOLLY_EXPERIMENTAL_ELIAS_FANO_CODING_H -#define FOLLY_EXPERIMENTAL_ELIAS_FANO_CODING_H +#pragma once #include #include @@ -684,5 +683,3 @@ class EliasFanoReader { }; }} // namespaces - -#endif // FOLLY_EXPERIMENTAL_ELIAS_FANO_CODING_H diff --git a/folly/experimental/EventCount.h b/folly/experimental/EventCount.h index 8c9fde82..e0f5a94d 100644 --- a/folly/experimental/EventCount.h +++ b/folly/experimental/EventCount.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXPERIMENTAL_EVENTCOUNT_H_ -#define FOLLY_EXPERIMENTAL_EVENTCOUNT_H_ +#pragma once #include #include @@ -210,5 +209,3 @@ void EventCount::await(Condition condition) { } } // namespace folly - -#endif /* FOLLY_EXPERIMENTAL_EVENTCOUNT_H_ */ diff --git a/folly/experimental/FunctionScheduler.h b/folly/experimental/FunctionScheduler.h index 08976f07..e3c0d132 100644 --- a/folly/experimental/FunctionScheduler.h +++ b/folly/experimental/FunctionScheduler.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXPERIMENTAL_FUNCTION_SCHEDULER_H_ -#define FOLLY_EXPERIMENTAL_FUNCTION_SCHEDULER_H_ +#pragma once #include #include @@ -263,5 +262,3 @@ class FunctionScheduler { }; } - -#endif diff --git a/folly/experimental/Instructions.h b/folly/experimental/Instructions.h index 732dd253..97386ff1 100644 --- a/folly/experimental/Instructions.h +++ b/folly/experimental/Instructions.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXPERIMENTAL_INSTRUCTIONS_H -#define FOLLY_EXPERIMENTAL_INSTRUCTIONS_H +#pragma once #include @@ -75,5 +74,3 @@ struct Haswell : public Nehalem { }; }}} // namespaces - -#endif // FOLLY_EXPERIMENTAL_INSTRUCTIONS_H diff --git a/folly/experimental/NestedCommandLineApp.h b/folly/experimental/NestedCommandLineApp.h index daa1188c..0a807a21 100644 --- a/folly/experimental/NestedCommandLineApp.h +++ b/folly/experimental/NestedCommandLineApp.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_NESTEDCOMMANDLINEAPP_H_ -#define FOLLY_NESTEDCOMMANDLINEAPP_H_ +#pragma once #include #include @@ -151,5 +150,3 @@ class NestedCommandLineApp { }; } // namespaces - -#endif /* FOLLY_NESTEDCOMMANDLINEAPP_H_ */ diff --git a/folly/experimental/ProgramOptions.h b/folly/experimental/ProgramOptions.h index 355b66f0..b51b9899 100644 --- a/folly/experimental/ProgramOptions.h +++ b/folly/experimental/ProgramOptions.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_PROGRAMOPTIONS_H_ -#define FOLLY_PROGRAMOPTIONS_H_ +#pragma once #include #include @@ -83,5 +82,3 @@ NestedCommandLineParseResult parseNestedCommandLine( const boost::program_options::options_description& desc); } // namespaces - -#endif /* FOLLY_PROGRAMOPTIONS_H_ */ diff --git a/folly/experimental/Select64.h b/folly/experimental/Select64.h index bee6970b..9c2e03f9 100644 --- a/folly/experimental/Select64.h +++ b/folly/experimental/Select64.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXPERIMENTAL_SELECT64_H -#define FOLLY_EXPERIMENTAL_SELECT64_H +#pragma once #include @@ -77,5 +76,3 @@ inline uint64_t select64(uint64_t x, } } // namespace folly - -#endif diff --git a/folly/experimental/StringKeyedCommon.h b/folly/experimental/StringKeyedCommon.h index f6816c9d..26eed9ef 100644 --- a/folly/experimental/StringKeyedCommon.h +++ b/folly/experimental/StringKeyedCommon.h @@ -16,8 +16,7 @@ // Copyright 2013-present Facebook. All Rights Reserved. // @author: Pavlo Kushnir (pavlo) -#ifndef FOLLY_EXPERIMENTAL_STRINGKEYEDCOMMON_H_ -#define FOLLY_EXPERIMENTAL_STRINGKEYEDCOMMON_H_ +#pragma once #include #include @@ -40,5 +39,3 @@ void stringPieceDel(StringPiece piece, const Alloc& alloc) { } } // folly - -#endif /* FOLLY_EXPERIMENTAL_STRINGKEYEDCOMMON_H_ */ diff --git a/folly/experimental/StringKeyedMap.h b/folly/experimental/StringKeyedMap.h index 1481c1e7..93d4559c 100644 --- a/folly/experimental/StringKeyedMap.h +++ b/folly/experimental/StringKeyedMap.h @@ -16,8 +16,7 @@ // Copyright 2013-present Facebook. All Rights Reserved. // @author: Pavlo Kushnir (pavlo) -#ifndef FOLLY_EXPERIMENTAL_STRINGKEYEDMAP_H_ -#define FOLLY_EXPERIMENTAL_STRINGKEYEDMAP_H_ +#pragma once #include #include @@ -200,5 +199,3 @@ public: }; } // folly - -#endif /* FOLLY_EXPERIMENTAL_STRINGKEYEDMAP_H_ */ diff --git a/folly/experimental/StringKeyedSet.h b/folly/experimental/StringKeyedSet.h index 0b7abbbc..f7e433bc 100644 --- a/folly/experimental/StringKeyedSet.h +++ b/folly/experimental/StringKeyedSet.h @@ -16,8 +16,7 @@ // Copyright 2013-present Facebook. All Rights Reserved. // @author: Pavlo Kushnir (pavlo) -#ifndef FOLLY_EXPERIMENTAL_STRINGKEYEDSET_H_ -#define FOLLY_EXPERIMENTAL_STRINGKEYEDSET_H_ +#pragma once #include #include @@ -185,5 +184,3 @@ public: using StringKeyedSet = StringKeyedSetBase<>; } // folly - -#endif /* FOLLY_EXPERIMENTAL_STRINGKEYEDSET_H_ */ diff --git a/folly/experimental/StringKeyedUnorderedMap.h b/folly/experimental/StringKeyedUnorderedMap.h index e31f96f5..59aa139f 100644 --- a/folly/experimental/StringKeyedUnorderedMap.h +++ b/folly/experimental/StringKeyedUnorderedMap.h @@ -16,8 +16,7 @@ // Copyright 2013-present Facebook. All Rights Reserved. // @author: Pavlo Kushnir (pavlo) -#ifndef FOLLY_EXPERIMENTAL_STRINGKEYEDUNORDEREDMAP_H_ -#define FOLLY_EXPERIMENTAL_STRINGKEYEDUNORDEREDMAP_H_ +#pragma once #include #include @@ -227,5 +226,3 @@ public: }; } // folly - -#endif /* FOLLY_EXPERIMENTAL_STRINGKEYEDUNORDEREDMAP_H_ */ diff --git a/folly/experimental/StringKeyedUnorderedSet.h b/folly/experimental/StringKeyedUnorderedSet.h index 1b33bfbf..e52feaa5 100644 --- a/folly/experimental/StringKeyedUnorderedSet.h +++ b/folly/experimental/StringKeyedUnorderedSet.h @@ -16,8 +16,7 @@ // Copyright 2013-present Facebook. All Rights Reserved. // @author: Pavlo Kushnir (pavlo) -#ifndef FOLLY_EXPERIMENTAL_STRINGKEYEDUNORDEREDSET_H_ -#define FOLLY_EXPERIMENTAL_STRINGKEYEDUNORDEREDSET_H_ +#pragma once #include #include @@ -221,5 +220,3 @@ public: typedef BasicStringKeyedUnorderedSet<> StringKeyedUnorderedSet; } // folly - -#endif /* FOLLY_EXPERIMENTAL_STRINGKEYEDUNORDEREDSET_H_ */ diff --git a/folly/experimental/TestUtil.h b/folly/experimental/TestUtil.h index 98af4c41..f5fb1638 100644 --- a/folly/experimental/TestUtil.h +++ b/folly/experimental/TestUtil.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_TESTUTIL_H_ -#define FOLLY_TESTUTIL_H_ +#pragma once #include #include @@ -213,5 +212,3 @@ private: } // namespace test } // namespace folly - -#endif /* FOLLY_TESTUTIL_H_ */ diff --git a/folly/experimental/TupleOps.h b/folly/experimental/TupleOps.h index c9b05bf8..65e30863 100644 --- a/folly/experimental/TupleOps.h +++ b/folly/experimental/TupleOps.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_TUPLEOPS_H_ -#define FOLLY_TUPLEOPS_H_ +#pragma once #include #include @@ -123,5 +122,3 @@ auto tuplePrepend(T&& car, U&& cdr) } } // namespaces - -#endif /* FOLLY_TUPLEOPS_H_ */ diff --git a/folly/experimental/exception_tracer/ExceptionAbi.h b/folly/experimental/exception_tracer/ExceptionAbi.h index 0fbea89f..9cee64fc 100644 --- a/folly/experimental/exception_tracer/ExceptionAbi.h +++ b/folly/experimental/exception_tracer/ExceptionAbi.h @@ -14,9 +14,7 @@ * limitations under the License. */ - -#ifndef FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONABI_H_ -#define FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONABI_H_ +#pragma once // A clone of the relevant parts of unwind-cxx.h from libstdc++ // The layout of these structures is defined by the ABI. @@ -56,5 +54,3 @@ __cxa_eh_globals* __cxa_get_globals_fast(void) noexcept; } } // namespace __cxxabiv1 - -#endif /* FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONABI_H_ */ diff --git a/folly/experimental/exception_tracer/ExceptionTracer.h b/folly/experimental/exception_tracer/ExceptionTracer.h index 3b7416a3..f356b9bb 100644 --- a/folly/experimental/exception_tracer/ExceptionTracer.h +++ b/folly/experimental/exception_tracer/ExceptionTracer.h @@ -17,8 +17,7 @@ // // Exception tracer library. -#ifndef FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACER_H_ -#define FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACER_H_ +#pragma once #include #include @@ -51,5 +50,3 @@ void installHandlers(); } // namespace exception_tracer } // namespace folly - -#endif /* FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACER_H_ */ diff --git a/folly/experimental/exception_tracer/ExceptionTracerLib.h b/folly/experimental/exception_tracer/ExceptionTracerLib.h index 72d16311..73d1f3a3 100644 --- a/folly/experimental/exception_tracer/ExceptionTracerLib.h +++ b/folly/experimental/exception_tracer/ExceptionTracerLib.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACERLIB_H_ -#define FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACERLIB_H_ +#pragma once #include #include @@ -50,5 +49,3 @@ void registerCxaEndCatchCallback(CxaEndCatchType callback); void registerRethrowExceptionCallback(RethrowExceptionType callback); } } - -#endif /* FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_EXCEPTIONTRACERLIB_H_ */ diff --git a/folly/experimental/exception_tracer/StackTrace.h b/folly/experimental/exception_tracer/StackTrace.h index 4a7e58f7..11a60648 100644 --- a/folly/experimental/exception_tracer/StackTrace.h +++ b/folly/experimental/exception_tracer/StackTrace.h @@ -14,9 +14,7 @@ * limitations under the License. */ - -#ifndef FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_STACKTRACE_H_ -#define FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_STACKTRACE_H_ +#pragma once #include #include @@ -98,5 +96,3 @@ class StackTraceStack { }; }} // namespaces - -#endif /* FOLLY_EXPERIMENTAL_EXCEPTION_TRACER_STACKTRACE_H_ */ diff --git a/folly/experimental/io/AsyncIO.h b/folly/experimental/io/AsyncIO.h index 6b3dfe0b..6a9ee6a4 100644 --- a/folly/experimental/io/AsyncIO.h +++ b/folly/experimental/io/AsyncIO.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_IO_ASYNCIO_H_ -#define FOLLY_IO_ASYNCIO_H_ +#pragma once #include #include @@ -251,5 +250,3 @@ class AsyncIOQueue { }; } // namespace folly - -#endif /* FOLLY_IO_ASYNCIO_H_ */ diff --git a/folly/experimental/io/FsUtil.h b/folly/experimental/io/FsUtil.h index fe677921..85606d1c 100644 --- a/folly/experimental/io/FsUtil.h +++ b/folly/experimental/io/FsUtil.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_IO_FSUTIL_H_ -#define FOLLY_IO_FSUTIL_H_ +#pragma once #include @@ -68,5 +67,3 @@ path executable_path(); } // namespace fs } // namespace folly - -#endif /* FOLLY_IO_FSUTIL_H_ */ diff --git a/folly/experimental/io/HugePages.h b/folly/experimental/io/HugePages.h index d1d23178..8d5619a2 100644 --- a/folly/experimental/io/HugePages.h +++ b/folly/experimental/io/HugePages.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_IO_HUGEPAGES_H_ -#define FOLLY_IO_HUGEPAGES_H_ +#pragma once #include #include @@ -79,5 +78,3 @@ const HugePageSize* getHugePageSize(size_t size = 0); const HugePageSize* getHugePageSizeForDevice(dev_t device); } // namespace folly - -#endif /* FOLLY_IO_HUGEPAGES_H_ */ diff --git a/folly/experimental/symbolizer/Dwarf.h b/folly/experimental/symbolizer/Dwarf.h index ba48486f..ed7d1ae8 100644 --- a/folly/experimental/symbolizer/Dwarf.h +++ b/folly/experimental/symbolizer/Dwarf.h @@ -16,8 +16,7 @@ // DWARF record parser -#ifndef FOLLY_EXPERIMENTAL_SYMBOLIZER_DWARF_H_ -#define FOLLY_EXPERIMENTAL_SYMBOLIZER_DWARF_H_ +#pragma once #include @@ -276,5 +275,3 @@ inline std::ostream& operator<<(std::ostream& out, const Dwarf::Path& path) { } // namespace symbolizer } // namespace folly - -#endif /* FOLLY_EXPERIMENTAL_SYMBOLIZER_DWARF_H_ */ diff --git a/folly/experimental/symbolizer/Elf.h b/folly/experimental/symbolizer/Elf.h index 9e2908dc..176a9e89 100644 --- a/folly/experimental/symbolizer/Elf.h +++ b/folly/experimental/symbolizer/Elf.h @@ -16,7 +16,7 @@ // ELF file parser -#ifndef FOLLY_EXPERIMENTAL_SYMBOLIZER_ELF_H_ +#pragma once #define FOLLY_EXPERIMENTAL_SYMBOLIZER_ELF_H_ #include @@ -241,5 +241,3 @@ class ElfFile { } // namespace folly #include - -#endif /* FOLLY_EXPERIMENTAL_SYMBOLIZER_ELF_H_ */ diff --git a/folly/experimental/symbolizer/ElfCache.h b/folly/experimental/symbolizer/ElfCache.h index 671b263b..eb01d210 100644 --- a/folly/experimental/symbolizer/ElfCache.h +++ b/folly/experimental/symbolizer/ElfCache.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SYMBOLIZER_ELFCACHE_H_ -#define FOLLY_SYMBOLIZER_ELFCACHE_H_ +#pragma once #include #include // for PATH_MAX @@ -130,5 +129,3 @@ class ElfCache : public ElfCacheBase { }; }} // namespaces - -#endif /* FOLLY_SYMBOLIZER_ELFCACHE_H_ */ diff --git a/folly/experimental/symbolizer/LineReader.h b/folly/experimental/symbolizer/LineReader.h index c1efb4e3..6137627e 100644 --- a/folly/experimental/symbolizer/LineReader.h +++ b/folly/experimental/symbolizer/LineReader.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SYMBOLIZER_LINEREADER_H_ -#define FOLLY_SYMBOLIZER_LINEREADER_H_ +#pragma once #include @@ -86,5 +85,3 @@ class LineReader : private boost::noncopyable { }; }} // namespaces - -#endif /* FOLLY_SYMBOLIZER_LINEREADER_H_ */ diff --git a/folly/experimental/symbolizer/SignalHandler.h b/folly/experimental/symbolizer/SignalHandler.h index 1dad2173..726c8a81 100644 --- a/folly/experimental/symbolizer/SignalHandler.h +++ b/folly/experimental/symbolizer/SignalHandler.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SYMBOLIZER_SIGNALHANDLER_H_ -#define FOLLY_SYMBOLIZER_SIGNALHANDLER_H_ +#pragma once #include @@ -51,5 +50,3 @@ void installFatalSignalCallbacks(); }} // namespaces - -#endif /* FOLLY_SYMBOLIZER_SIGNALHANDLER_H_ */ diff --git a/folly/experimental/symbolizer/StackTrace.h b/folly/experimental/symbolizer/StackTrace.h index 8f6c28a3..9fc8afa7 100644 --- a/folly/experimental/symbolizer/StackTrace.h +++ b/folly/experimental/symbolizer/StackTrace.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SYMBOLIZER_STACKTRACE_H_ -#define FOLLY_SYMBOLIZER_STACKTRACE_H_ +#pragma once #include #include @@ -45,5 +44,3 @@ ssize_t getStackTrace(uintptr_t* addresses, size_t maxAddresses); ssize_t getStackTraceSafe(uintptr_t* addresses, size_t maxAddresses); }} // namespaces - -#endif /* FOLLY_SYMBOLIZER_STACKTRACE_H_ */ diff --git a/folly/experimental/symbolizer/Symbolizer.h b/folly/experimental/symbolizer/Symbolizer.h index cad7013e..232cb30b 100644 --- a/folly/experimental/symbolizer/Symbolizer.h +++ b/folly/experimental/symbolizer/Symbolizer.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXPERIMENTAL_SYMBOLIZER_SYMBOLIZER_H_ -#define FOLLY_EXPERIMENTAL_SYMBOLIZER_SYMBOLIZER_H_ +#pragma once #include #include @@ -295,5 +294,3 @@ class StringSymbolizePrinter : public SymbolizePrinter { } // namespace symbolizer } // namespace folly - -#endif /* FOLLY_EXPERIMENTAL_SYMBOLIZER_SYMBOLIZER_H_ */ diff --git a/folly/experimental/symbolizer/test/SignalHandlerTest.h b/folly/experimental/symbolizer/test/SignalHandlerTest.h index 2a195a98..6a7d8b7a 100644 --- a/folly/experimental/symbolizer/test/SignalHandlerTest.h +++ b/folly/experimental/symbolizer/test/SignalHandlerTest.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SYMBOLIZER_TEST_SIGNALHANDLERTEST_H_ -#define FOLLY_SYMBOLIZER_TEST_SIGNALHANDLERTEST_H_ +#pragma once namespace folly { namespace symbolizer { namespace test { @@ -24,5 +23,3 @@ inline void failHard() { } }}} // namespaces - -#endif /* FOLLY_SYMBOLIZER_TEST_SIGNALHANDLERTEST_H_ */ diff --git a/folly/experimental/test/CodingTestUtils.h b/folly/experimental/test/CodingTestUtils.h index 9c25ad1a..d16f31e7 100644 --- a/folly/experimental/test/CodingTestUtils.h +++ b/folly/experimental/test/CodingTestUtils.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_EXPERIMENTAL_CODING_TEST_UTILS_H -#define FOLLY_EXPERIMENTAL_CODING_TEST_UTILS_H +#pragma once #include #include @@ -371,5 +370,3 @@ void bmJumpTo(const List& list, const std::vector& data, } }} // namespaces - -#endif // FOLLY_EXPERIMENTAL_CODING_TEST_UTILS_H diff --git a/folly/gen/Base-inl.h b/folly/gen/Base-inl.h index 3b756fbc..11308b3e 100644 --- a/folly/gen/Base-inl.h +++ b/folly/gen/Base-inl.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_BASE_H +#ifndef FOLLY_GEN_BASE_H_ #error This file may only be included from folly/gen/Base.h #endif diff --git a/folly/gen/Base.h b/folly/gen/Base.h index 9cd8e8f0..6cf05d17 100644 --- a/folly/gen/Base.h +++ b/folly/gen/Base.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_BASE_H -#define FOLLY_GEN_BASE_H +#pragma once +#define FOLLY_GEN_BASE_H_ #include #include @@ -826,5 +826,3 @@ UnwrapOr unwrapOr(Fallback&& fallback) { }} // folly::gen #include - -#endif // FOLLY_GEN_BASE_H diff --git a/folly/gen/Combine-inl.h b/folly/gen/Combine-inl.h index 0ce96b0e..994d93c9 100644 --- a/folly/gen/Combine-inl.h +++ b/folly/gen/Combine-inl.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_COMBINE_H +#ifndef FOLLY_GEN_COMBINE_H_ #error This file may only be included from folly/gen/Combine.h #endif diff --git a/folly/gen/Combine.h b/folly/gen/Combine.h index 243350d8..bd9362e2 100644 --- a/folly/gen/Combine.h +++ b/folly/gen/Combine.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_COMBINE_H -#define FOLLY_GEN_COMBINE_H +#pragma once +#define FOLLY_GEN_COMBINE_H_ #include @@ -42,5 +42,3 @@ Interleave interleave(Source2&& source2) { } // namespace folly #include - -#endif // FOLLY_GEN_COMBINE_H diff --git a/folly/gen/Core-inl.h b/folly/gen/Core-inl.h index 8e6f02f2..4f22d9b3 100644 --- a/folly/gen/Core-inl.h +++ b/folly/gen/Core-inl.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_CORE_H +#ifndef FOLLY_GEN_CORE_H_ #error This file may only be included from folly/gen/Core.h #endif diff --git a/folly/gen/Core.h b/folly/gen/Core.h index 59455da2..6bfc7cf0 100644 --- a/folly/gen/Core.h +++ b/folly/gen/Core.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_CORE_H -#define FOLLY_GEN_CORE_H +#pragma once +#define FOLLY_GEN_CORE_H_ namespace folly { namespace gen { @@ -41,5 +41,3 @@ class Chain; }} // folly::gen #include - -#endif // FOLLY_GEN_CORE_H diff --git a/folly/gen/File-inl.h b/folly/gen/File-inl.h index 4de5f588..98981ef9 100644 --- a/folly/gen/File-inl.h +++ b/folly/gen/File-inl.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_FILE_H +#ifndef FOLLY_GEN_FILE_H_ #error This file may only be included from folly/gen/File.h #endif diff --git a/folly/gen/File.h b/folly/gen/File.h index 1c5a36d4..cc031698 100644 --- a/folly/gen/File.h +++ b/folly/gen/File.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_FILE_H -#define FOLLY_GEN_FILE_H +#pragma once +#define FOLLY_GEN_FILE_H_ #include #include @@ -68,5 +68,3 @@ S toFile(File file, std::unique_ptr buffer) { }} // !folly::gen #include - -#endif // FOLLY_GEN_FILE_H diff --git a/folly/gen/Parallel.h b/folly/gen/Parallel.h index 74cf955e..106ae945 100644 --- a/folly/gen/Parallel.h +++ b/folly/gen/Parallel.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_PARALLEL_H_ +#pragma once #define FOLLY_GEN_PARALLEL_H_ #include @@ -106,5 +106,3 @@ Sub sub(Sink sink) { }} // !namespace folly::gen #include - -#endif /* FOLLY_GEN_PARALLEL_H_ */ diff --git a/folly/gen/ParallelMap-inl.h b/folly/gen/ParallelMap-inl.h index fcabf5b9..eb2899cd 100644 --- a/folly/gen/ParallelMap-inl.h +++ b/folly/gen/ParallelMap-inl.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_PARALLELMAP_H +#ifndef FOLLY_GEN_PARALLELMAP_H_ #error This file may only be included from folly/gen/ParallelMap.h #endif diff --git a/folly/gen/ParallelMap.h b/folly/gen/ParallelMap.h index 35aa970b..9a3e3c7e 100644 --- a/folly/gen/ParallelMap.h +++ b/folly/gen/ParallelMap.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_PARALLELMAP_H -#define FOLLY_GEN_PARALLELMAP_H +#pragma once +#define FOLLY_GEN_PARALLELMAP_H_ #include @@ -46,5 +46,3 @@ template - -#endif // FOLLY_GEN_PARALLELMAP_H diff --git a/folly/gen/String-inl.h b/folly/gen/String-inl.h index 64cd3cc0..e87974da 100644 --- a/folly/gen/String-inl.h +++ b/folly/gen/String-inl.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_STRING_H +#ifndef FOLLY_GEN_STRING_H_ #error This file may only be included from folly/gen/String.h #endif diff --git a/folly/gen/String.h b/folly/gen/String.h index 40ce1712..ac3c2998 100644 --- a/folly/gen/String.h +++ b/folly/gen/String.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_STRING_H -#define FOLLY_GEN_STRING_H +#pragma once +#define FOLLY_GEN_STRING_H_ #include #include @@ -246,5 +246,3 @@ StreamSplitter streamSplitter(char delimiter, } // namespace folly #include - -#endif // FOLLY_GEN_STRING_H diff --git a/folly/gen/test/Bench.h b/folly/gen/test/Bench.h index d86a7efa..a4104598 100644 --- a/folly/gen/test/Bench.h +++ b/folly/gen/test/Bench.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GEN_BENCH_H_ -#define FOLLY_GEN_BENCH_H_ +#pragma once #include @@ -31,5 +30,3 @@ static bool FB_ANONYMOUS_VARIABLE(benchGen) = ( \ }), true) #define BENCH_GEN(gen) BENCH_GEN_IMPL(gen, "") #define BENCH_GEN_REL(gen) BENCH_GEN_IMPL(gen, "%") - -#endif diff --git a/folly/init/Init.h b/folly/init/Init.h index 8c1bc7e5..52e96f25 100644 --- a/folly/init/Init.h +++ b/folly/init/Init.h @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef INIT_LIGHT_BASE_H -#define INIT_LIGHT_BASE_H + +#pragma once /* * Calls common init functions in the necessary order @@ -31,5 +31,3 @@ namespace folly { void init(int* argc, char*** argv, bool removeFlags = true); } // folly - -#endif diff --git a/folly/io/Compression.h b/folly/io/Compression.h index 540a08a1..3575d8e4 100644 --- a/folly/io/Compression.h +++ b/folly/io/Compression.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_IO_COMPRESSION_H_ -#define FOLLY_IO_COMPRESSION_H_ +#pragma once #include #include @@ -180,5 +179,3 @@ std::unique_ptr getCodec(CodecType type, int level = COMPRESSION_LEVEL_DEFAULT); }} // namespaces - -#endif /* FOLLY_IO_COMPRESSION_H_ */ diff --git a/folly/io/Cursor.h b/folly/io/Cursor.h index d1ec9636..74412ea6 100644 --- a/folly/io/Cursor.h +++ b/folly/io/Cursor.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_CURSOR_H -#define FOLLY_CURSOR_H +#pragma once #include #include @@ -922,5 +921,3 @@ class QueueAppender : public detail::Writable { }; }} // folly::io - -#endif // FOLLY_CURSOR_H diff --git a/folly/io/IOBuf.h b/folly/io/IOBuf.h index 5262fb5f..f6a43d66 100644 --- a/folly/io/IOBuf.h +++ b/folly/io/IOBuf.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_IO_IOBUF_H_ -#define FOLLY_IO_IOBUF_H_ +#pragma once #include #include @@ -1467,5 +1466,3 @@ inline IOBuf::Iterator IOBuf::end() const { return cend(); } } // folly #pragma GCC diagnostic pop - -#endif // FOLLY_IO_IOBUF_H_ diff --git a/folly/io/IOBufQueue.h b/folly/io/IOBufQueue.h index 81ffe92a..d421f917 100644 --- a/folly/io/IOBufQueue.h +++ b/folly/io/IOBufQueue.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_IO_IOBUF_QUEUE_H -#define FOLLY_IO_IOBUF_QUEUE_H +#pragma once #include @@ -295,5 +294,3 @@ class IOBufQueue { }; } // folly - -#endif // FOLLY_IO_IOBUF_QUEUE_H diff --git a/folly/io/RecordIO.h b/folly/io/RecordIO.h index faf89029..6a89ce81 100644 --- a/folly/io/RecordIO.h +++ b/folly/io/RecordIO.h @@ -22,7 +22,8 @@ * or deleted chunks of the file, or modified data. When reading, you may lose * corrupted records, but the stream will resynchronize automatically. */ -#ifndef FOLLY_IO_RECORDIO_H_ + +#pragma once #define FOLLY_IO_RECORDIO_H_ #include @@ -176,5 +177,3 @@ RecordInfo validateRecord(ByteRange range, uint32_t fileId); } // namespaces #include - -#endif /* FOLLY_IO_RECORDIO_H_ */ diff --git a/folly/io/TypedIOBuf.h b/folly/io/TypedIOBuf.h index e958490c..0a58bbc6 100644 --- a/folly/io/TypedIOBuf.h +++ b/folly/io/TypedIOBuf.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_IO_TYPEDIOBUF_H_ -#define FOLLY_IO_TYPEDIOBUF_H_ +#pragma once #include #include @@ -214,5 +213,3 @@ class TypedIOBuf { }; } // namespace folly - -#endif /* FOLLY_IO_TYPEDIOBUF_H_ */ diff --git a/folly/json.h b/folly/json.h index 2854b76a..b3ed871a 100644 --- a/folly/json.h +++ b/folly/json.h @@ -38,8 +38,7 @@ * @author Jordan DeLong */ -#ifndef FOLLY_JSON_H_ -#define FOLLY_JSON_H_ +#pragma once #include @@ -168,5 +167,3 @@ void PrintTo(const dynamic&, std::ostream*); ////////////////////////////////////////////////////////////////////// } - -#endif diff --git a/folly/portability/Constexpr.h b/folly/portability/Constexpr.h index 7ea46300..3625e265 100755 --- a/folly/portability/Constexpr.h +++ b/folly/portability/Constexpr.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_CONSTEXPR_H_ -#define FOLLY_CONSTEXPR_H_ +#pragma once #include #include @@ -50,5 +49,3 @@ constexpr size_t constexpr_strlen(const char* s) { #endif } } - -#endif diff --git a/folly/portability/GFlags.h b/folly/portability/GFlags.h index 976ecccc..d28c6a28 100644 --- a/folly/portability/GFlags.h +++ b/folly/portability/GFlags.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_GFLAGS_H_ -#define FOLLY_GFLAGS_H_ +#pragma once #include @@ -24,5 +23,3 @@ #else #define DEFINE_int32(_name, _default, _description) int FLAGS_##_name = _default #endif - -#endif diff --git a/folly/portability/SysUio.h b/folly/portability/SysUio.h index e0ab7f37..9640f680 100644 --- a/folly/portability/SysUio.h +++ b/folly/portability/SysUio.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SYSUIO_H_ -#define FOLLY_SYSUIO_H_ +#pragma once #include @@ -27,5 +26,3 @@ constexpr size_t kIovMax = IOV_MAX; constexpr size_t kIovMax = UIO_MAXIOV; #endif } - -#endif diff --git a/folly/small_vector.h b/folly/small_vector.h index 4707a146..b81d318a 100644 --- a/folly/small_vector.h +++ b/folly/small_vector.h @@ -20,8 +20,8 @@ * * @author Jordan DeLong */ -#ifndef FOLLY_SMALL_VECTOR_H_ -#define FOLLY_SMALL_VECTOR_H_ + +#pragma once #include #include @@ -1160,5 +1160,3 @@ struct IndexableTraits> # undef FB_PACK_PUSH # undef FB_PACK_POP #endif - -#endif diff --git a/folly/sorted_vector_types.h b/folly/sorted_vector_types.h index 99019d0d..b9354b10 100644 --- a/folly/sorted_vector_types.h +++ b/folly/sorted_vector_types.h @@ -57,8 +57,7 @@ * std::vector<>, which requires it to be Assignable.) */ -#ifndef FOLLY_SORTED_VECTOR_TYPES_H_ -#define FOLLY_SORTED_VECTOR_TYPES_H_ +#pragma once #include #include @@ -654,5 +653,3 @@ inline void swap(sorted_vector_map& a, ////////////////////////////////////////////////////////////////////// } - -#endif diff --git a/folly/stats/BucketedTimeSeries-defs.h b/folly/stats/BucketedTimeSeries-defs.h index e9a749a7..a726f2ee 100644 --- a/folly/stats/BucketedTimeSeries-defs.h +++ b/folly/stats/BucketedTimeSeries-defs.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_STATS_BUCKETEDTIMESERIES_INL_H_ -#define FOLLY_STATS_BUCKETEDTIMESERIES_INL_H_ +#pragma once #include #include @@ -461,5 +460,3 @@ void BucketedTimeSeries::forEachBucket(TimeType start, TimeType end, } } // folly - -#endif // FOLLY_STATS_BUCKETEDTIMESERIES_INL_H_ diff --git a/folly/stats/BucketedTimeSeries.h b/folly/stats/BucketedTimeSeries.h index 8ce00b2b..c3c2c1e4 100644 --- a/folly/stats/BucketedTimeSeries.h +++ b/folly/stats/BucketedTimeSeries.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_STATS_BUCKETEDTIMESERIES_H_ -#define FOLLY_STATS_BUCKETEDTIMESERIES_H_ +#pragma once #include #include @@ -406,5 +405,3 @@ class BucketedTimeSeries { }; } // folly - -#endif // FOLLY_STATS_BUCKETEDTIMESERIES_H_ diff --git a/folly/stats/Histogram-defs.h b/folly/stats/Histogram-defs.h index fe102bf2..8d4af44f 100644 --- a/folly/stats/Histogram-defs.h +++ b/folly/stats/Histogram-defs.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_HISTOGRAM_DEFS_H_ -#define FOLLY_HISTOGRAM_DEFS_H_ +#pragma once #include @@ -278,5 +277,3 @@ void Histogram::toTSV(std::ostream& out, bool skipEmptyBuckets) const { } } // folly - -#endif // FOLLY_HISTOGRAM_DEFS_H_ diff --git a/folly/stats/Histogram.h b/folly/stats/Histogram.h index beda7c82..0b9baba1 100644 --- a/folly/stats/Histogram.h +++ b/folly/stats/Histogram.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_HISTOGRAM_H_ -#define FOLLY_HISTOGRAM_H_ +#pragma once #include #include @@ -466,5 +465,3 @@ class Histogram { }; } // folly - -#endif // FOLLY_HISTOGRAM_H_ diff --git a/folly/stats/MultiLevelTimeSeries-defs.h b/folly/stats/MultiLevelTimeSeries-defs.h index 396c9049..686dafa6 100644 --- a/folly/stats/MultiLevelTimeSeries-defs.h +++ b/folly/stats/MultiLevelTimeSeries-defs.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_STATS_MULTILEVELTIMESERIES_DEFS_H_ -#define FOLLY_STATS_MULTILEVELTIMESERIES_DEFS_H_ +#pragma once #include @@ -100,5 +99,3 @@ void MultiLevelTimeSeries::clear() { } } // folly - -#endif // FOLLY_STATS_MULTILEVELTIMESERIES_DEFS_H_ diff --git a/folly/stats/MultiLevelTimeSeries.h b/folly/stats/MultiLevelTimeSeries.h index e8de4443..f38b4e9f 100644 --- a/folly/stats/MultiLevelTimeSeries.h +++ b/folly/stats/MultiLevelTimeSeries.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_STATS_MULTILEVELTIMESERIES_H_ -#define FOLLY_STATS_MULTILEVELTIMESERIES_H_ +#pragma once #include #include @@ -311,5 +310,3 @@ class MultiLevelTimeSeries { }; } // folly - -#endif // FOLLY_STATS_MULTILEVELTIMESERIES_H_ diff --git a/folly/stats/TimeseriesHistogram-defs.h b/folly/stats/TimeseriesHistogram-defs.h index ff88c0e6..f546d8bc 100644 --- a/folly/stats/TimeseriesHistogram-defs.h +++ b/folly/stats/TimeseriesHistogram-defs.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_TIMESERIES_HISTOGRAM_DEF_H_ -#define FOLLY_TIMESERIES_HISTOGRAM_DEF_H_ +#pragma once #include #include @@ -227,5 +226,3 @@ std::string TimeseriesHistogram::getString(TimeType start, } } // namespace folly - -#endif diff --git a/folly/stats/TimeseriesHistogram.h b/folly/stats/TimeseriesHistogram.h index 7f58b0d2..2f3cc75f 100644 --- a/folly/stats/TimeseriesHistogram.h +++ b/folly/stats/TimeseriesHistogram.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_TIMESERIES_HISTOGRAM_H_ -#define FOLLY_TIMESERIES_HISTOGRAM_H_ +#pragma once #include #include @@ -331,5 +330,3 @@ class TimeseriesHistogram { }; } // folly - -#endif // FOLLY_TIMESERIES_HISTOGRAM_H_ diff --git a/folly/test/SynchronizedTestLib-inl.h b/folly/test/SynchronizedTestLib-inl.h index 5399f127..1517730e 100644 --- a/folly/test/SynchronizedTestLib-inl.h +++ b/folly/test/SynchronizedTestLib-inl.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_TEST_SYNCHRONIZEDTESTLIB_INL_H -#define FOLLY_TEST_SYNCHRONIZEDTESTLIB_INL_H +#pragma once #include @@ -353,6 +352,3 @@ template void testInPlaceConstruction() { folly::construct_in_place, 5, "a" ); } - - -#endif /* FOLLY_TEST_SYNCHRONIZEDTESTLIB_INL_H */ diff --git a/folly/test/SynchronizedTestLib.h b/folly/test/SynchronizedTestLib.h index 349ed12b..8e73273d 100644 --- a/folly/test/SynchronizedTestLib.h +++ b/folly/test/SynchronizedTestLib.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_TEST_SYNCHRONIZEDTESTLIB_H -#define FOLLY_TEST_SYNCHRONIZEDTESTLIB_H +#pragma once // We have mutex types outside of folly that we want to test with Synchronized. // Make it easy for mutex implementators to test their classes with @@ -47,5 +46,3 @@ template void testConstCopy(); template void testInPlaceConstruction(); #include - -#endif /* FOLLY_TEST_SYNCHRONIZEDTESTLIB_H */ diff --git a/folly/test/TestUtils.h b/folly/test/TestUtils.h index 1c7b4acd..14a6012d 100644 --- a/folly/test/TestUtils.h +++ b/folly/test/TestUtils.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_TESTUTILS_H -#define FOLLY_TESTUTILS_H +#pragma once #include @@ -25,5 +24,3 @@ // a normal test failure; there is only an effect if the test framework // interprets the message. #define SKIP() GTEST_FATAL_FAILURE_("Test skipped by client") - -#endif // FOLLY_TESTUTILS_H diff --git a/folly/test/function_benchmark/benchmark_impl.h b/folly/test/function_benchmark/benchmark_impl.h index d7766fbc..b6865f7a 100644 --- a/folly/test/function_benchmark/benchmark_impl.h +++ b/folly/test/function_benchmark/benchmark_impl.h @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef BENCHMARK_IMPL_H_ -#define BENCHMARK_IMPL_H_ + +#pragma once #include @@ -49,5 +49,3 @@ void BM_invoke_fn_template_impl(int iters, const T& fn) { fn(); } } - -#endif // BENCHMARK_IMPL_H_ diff --git a/folly/test/function_benchmark/test_functions.h b/folly/test/function_benchmark/test_functions.h index 382ac39d..e248aa63 100644 --- a/folly/test/function_benchmark/test_functions.h +++ b/folly/test/function_benchmark/test_functions.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef TEST_FUNCTIONS_H_ -#define TEST_FUNCTIONS_H_ +#pragma once #include #include @@ -54,5 +53,3 @@ class LargeClass { // Avoid small object optimization. char data[1024]; }; - -#endif // TEST_FUNCTIONS_H_ -- 2.34.1