Commit dee8a518 authored by Sven Over's avatar Sven Over Committed by Facebook Github Bot 4

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
parent 94070f19
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_ARENA_H_
#pragma once
#define FOLLY_ARENA_H_
#include <cassert>
......@@ -243,5 +243,3 @@ struct IsArenaAllocator<SysArena> : std::true_type { };
} // namespace folly
#include <folly/Arena-inl.h>
#endif /* FOLLY_ARENA_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_BASE_ASSUME_H_
#define FOLLY_BASE_ASSUME_H_
#pragma once
#include <folly/Portability.h>
#include <glog/logging.h>
......@@ -45,5 +44,3 @@ FOLLY_ALWAYS_INLINE void assume(bool cond) {
}
} // namespace folly
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_ATOMICBITSET_H_
#define FOLLY_ATOMICBITSET_H_
#pragma once
#include <array>
#include <atomic>
......@@ -158,5 +157,3 @@ inline bool AtomicBitSet<N>::operator[](size_t idx) const {
}
} // namespaces
#endif /* FOLLY_ATOMICBITSET_H_ */
......@@ -29,7 +29,7 @@
* @author Jordan DeLong <delong.j@fb.com>
*/
#ifndef FOLLY_ATOMICHASHARRAY_H_
#pragma once
#define FOLLY_ATOMICHASHARRAY_H_
#include <atomic>
......@@ -429,5 +429,3 @@ friend class AtomicHashMap<KeyT,
} // namespace folly
#include <folly/AtomicHashArray-inl.h>
#endif // FOLLY_ATOMICHASHARRAY_H_
......@@ -79,7 +79,7 @@
*
*/
#ifndef FOLLY_ATOMICHASHMAP_H_
#pragma once
#define FOLLY_ATOMICHASHMAP_H_
#include <boost/iterator/iterator_facade.hpp>
......@@ -472,5 +472,3 @@ using QuadraticProbingAtomicHashMap =
} // namespace folly
#include <folly/AtomicHashMap-inl.h>
#endif // FOLLY_ATOMICHASHMAP_H_
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_ATOMIC_LINKED_LIST_H_
#define FOLLY_ATOMIC_LINKED_LIST_H_
#pragma once
#include <atomic>
#include <cassert>
......@@ -134,5 +133,3 @@ class AtomicLinkedList {
};
} // namespace folly
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_ATOMIC_STRUCT_H_
#define FOLLY_ATOMIC_STRUCT_H_
#pragma once
#include <atomic>
#include <type_traits>
......@@ -135,5 +134,3 @@ template <> struct AtomicStructIntPick<8> { typedef uint64_t type; };
} // namespace detail
} // namespace folly
#endif
......@@ -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 <atomic>
#include <functional>
......@@ -519,4 +519,3 @@ struct MutableData {
}
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_BATON_H
#define FOLLY_BATON_H
#pragma once
#include <stdint.h>
#include <atomic>
......@@ -297,5 +296,3 @@ struct Baton {
};
} // namespace folly
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_BENCHMARK_H_
#define FOLLY_BENCHMARK_H_
#pragma once
#include <folly/Portability.h>
#include <folly/Preprocessor.h> // 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_
......@@ -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_ */
......@@ -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
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_CHECKSUM_H_
#define FOLLY_CHECKSUM_H_
#pragma once
#include <stdint.h>
#include <cstddef>
......@@ -39,5 +38,3 @@ uint32_t crc32c(const uint8_t* data, size_t nbytes,
uint32_t startingChecksum = ~0U);
} // folly
#endif /* FOLLY_CHECKSUM_H_ */
......@@ -16,8 +16,7 @@
// @author: Xin Liu <xliux@fb.com>
#ifndef FOLLY_CONCURRENTSKIPLIST_INL_H_
#define FOLLY_CONCURRENTSKIPLIST_INL_H_
#pragma once
#include <algorithm>
#include <atomic>
......@@ -333,5 +332,3 @@ class NodeRecycler<NodeType, NodeAlloc, typename std::enable_if<
};
}} // namespaces
#endif // FOLLY_CONCURRENTSKIPLIST_INL_H_
......@@ -117,8 +117,7 @@ Sample usage:
}
*/
#ifndef FOLLY_CONCURRENT_SKIP_LIST_H_
#define FOLLY_CONCURRENT_SKIP_LIST_H_
#pragma once
#include <algorithm>
#include <atomic>
......@@ -800,5 +799,3 @@ class ConcurrentSkipList<T, Comp, NodeAlloc, MAX_HEIGHT>::Skipper {
};
} // namespace folly
#endif // FOLLY_CONCURRENT_SKIP_LIST_H_
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_BASE_CONTAINER_TRAITS_H_
#define FOLLY_BASE_CONTAINER_TRAITS_H_
#pragma once
#include <folly/Traits.h>
......@@ -41,5 +40,3 @@ container_emplace_back_or_push_back(Container& container, Args&&... args) {
}
}
#endif
......@@ -21,8 +21,7 @@
* @author Andrei Alexandrescu (andrei.alexandrescu@fb.com)
*/
#ifndef FOLLY_BASE_CONV_H_
#define FOLLY_BASE_CONV_H_
#pragma once
#include <folly/FBString.h>
#include <folly/Likely.h>
......@@ -1287,5 +1286,3 @@ to(const Src & value) {
#undef FOLLY_RANGE_CHECK_STRINGIZE
#undef FOLLY_RANGE_CHECK_STRINGIZE2
#endif
#endif /* FOLLY_BASE_CONV_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_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_CPUID_H_
#define FOLLY_CPUID_H_
#pragma once
#include <cstdint>
#include <folly/Portability.h>
......@@ -196,5 +195,3 @@ class CpuId {
};
} // namespace folly
#endif /* FOLLY_CPUID_H_ */
......@@ -24,8 +24,7 @@
* @author Tudor Bosman (tudorb@fb.com)
*/
#ifndef FOLLY_DISCRIMINATEDPTR_H_
#define FOLLY_DISCRIMINATEDPTR_H_
#pragma once
#include <limits>
#include <stdexcept>
......@@ -217,5 +216,3 @@ class DiscriminatedPtr {
};
} // namespace folly
#endif /* FOLLY_DISCRIMINATEDPTR_H_ */
......@@ -16,8 +16,7 @@
// @author Nicholas Ormrod <njormrod@fb.com>
#ifndef DYNAMIC_CONVERTER_H
#define DYNAMIC_CONVERTER_H
#pragma once
#include <folly/dynamic.h>
namespace folly {
......@@ -354,5 +353,3 @@ dynamic toDynamic(const T& x) {
}
} // namespace folly
#endif // DYNAMIC_CONVERTER_H
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_EVICTINGHASHMAP_H_
#define FOLLY_EVICTINGHASHMAP_H_
#pragma once
#include <algorithm>
#include <exception>
......@@ -492,5 +491,3 @@ class EvictingCacheMap : private boost::noncopyable {
};
} // folly
#endif /* FOLLY_EVICTINGHASHMAP_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_EXCEPTION_H_
#define FOLLY_EXCEPTION_H_
#pragma once
#include <errno.h>
......@@ -119,5 +118,3 @@ void throwOnFail(V&& value, Args&&... args) {
::folly::throwOnFail<E>((cond), "Check failed: " #cond)
} // namespace folly
#endif /* FOLLY_EXCEPTION_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_EXCEPTIONWRAPPER_H
#define FOLLY_EXCEPTIONWRAPPER_H
#pragma once
#include <cassert>
#include <exception>
......@@ -468,4 +467,3 @@ class try_and_catch<> : public exception_wrapper {
}
};
}
#endif
......@@ -17,8 +17,7 @@
// @author: Andrei Alexandrescu (aalexandre)
// String type.
#ifndef FOLLY_BASE_FBSTRING_H_
#define FOLLY_BASE_FBSTRING_H_
#pragma once
#include <atomic>
#include <limits>
......@@ -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_
......@@ -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<T, A>& v, T* data, size_t sz, size_t cap) {
}
} // namespace folly
#endif // FOLLY_FBVECTOR_H
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_FILE_H_
#define FOLLY_FILE_H_
#pragma once
#include <fcntl.h>
#include <sys/stat.h>
......@@ -136,5 +135,3 @@ void swap(File& a, File& b);
} // namespace folly
#endif /* FOLLY_FILE_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_FILEUTIL_H_
#define FOLLY_FILEUTIL_H_
#pragma once
#include <folly/Conv.h>
#include <folly/Portability.h>
......@@ -193,5 +192,3 @@ bool writeFile(const Container& data, const char* filename,
}
} // namespaces
#endif /* FOLLY_FILEUTIL_H_ */
......@@ -42,8 +42,7 @@
* @author Tudor Bosman (tudorb@facebook.com)
*/
#ifndef FOLLY_FINGERPRINT_H_
#define FOLLY_FINGERPRINT_H_
#pragma once
#include <cstdint>
......@@ -261,5 +260,3 @@ inline uint64_t Fingerprint<128>::shlor64(uint64_t v) {
}
} // namespace folly
#endif /* FOLLY_FINGERPRINT_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
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_FORMAT_H_
#pragma once
#define FOLLY_FORMAT_H_
#include <cstdio>
......@@ -433,5 +433,3 @@ vformatChecked(Str* out, StringPiece fmt, Container&& container) {
#include <folly/Format-inl.h>
#pragma GCC diagnostic pop
#endif /* FOLLY_FORMAT_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_FORMATARG_H_
#define FOLLY_FORMATARG_H_
#pragma once
#include <stdexcept>
#include <folly/Conv.h>
......@@ -275,5 +274,3 @@ inline int FormatArg::splitIntKey() {
}
} // namespace folly
#endif /* FOLLY_FORMATARG_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_FORMAT_TRAITS_H_
#define FOLLY_FORMAT_TRAITS_H_
#pragma once
#include <type_traits>
......@@ -62,5 +61,3 @@ struct IndexableTraitsAssoc : public FormatTraitsBase {
};
}} // namespaces
#endif /* FOLLY_FORMAT_TRAITS_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<uint64_t> GroupVarint64Decoder;
} // namespace folly
#endif /* FOLLY_X64 || defined(__i386__) || FOLLY_PPC64 */
#endif /* FOLLY_GROUPVARINT_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_BASE_HASH_H_
#define FOLLY_BASE_HASH_H_
#pragma once
#include <cstdint>
#include <cstring>
......@@ -460,5 +459,3 @@ namespace std {
}
};
} // namespace std
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_INDEXEDMEMPOOL_H
#define FOLLY_INDEXEDMEMPOOL_H
#pragma once
#include <type_traits>
#include <stdint.h>
......@@ -466,4 +465,3 @@ struct IndexedMemPoolRecycler {
} // namespace folly
# pragma GCC diagnostic pop
#endif
......@@ -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<true>>;
} // folly
#endif // FOLLY_INTRUSIVELIST_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 <utility>
#include <type_traits>
......@@ -131,5 +131,3 @@ lazy(Func&& fun) {
//////////////////////////////////////////////////////////////////////
}
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_LIFOSEM_H
#define FOLLY_LIFOSEM_H
#pragma once
#include <string.h>
#include <stdint.h>
......@@ -605,5 +604,3 @@ struct LifoSemImpl : public detail::LifoSemBase<BatonType, Atom> {
};
} // namespace folly
#endif
......@@ -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_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_LOGGING_H_
#define FOLLY_LOGGING_H_
#pragma once
#include <atomic>
#include <chrono>
......@@ -54,5 +53,3 @@
LOG(severity)
#endif
#endif // FOLLY_LOGGING_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_
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_MAPUTIL_H_
#define FOLLY_MAPUTIL_H_
#pragma once
#include <folly/Conv.h>
#include <folly/Optional.h>
......@@ -100,5 +99,3 @@ typename Map::mapped_type* get_ptr(
}
} // namespace folly
#endif /* FOLLY_MAPUTIL_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_MEMORY_H_
#define FOLLY_MEMORY_H_
#pragma once
#include <folly/Traits.h>
#include <folly/portability/Memory.h>
......@@ -418,5 +417,3 @@ std::shared_ptr<T> allocate_shared(Allocator&& allocator, Args&&... args) {
template <class T> struct IsArenaAllocator : std::false_type { };
} // namespace folly
#endif /* FOLLY_MEMORY_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_MEMORYMAPPING_H_
#define FOLLY_MEMORYMAPPING_H_
#pragma once
#include <folly/FBString.h>
#include <folly/File.h>
......@@ -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_ */
......@@ -36,8 +36,7 @@
* from a.
*/
#ifndef FOLLY_MERGE_H_
#define FOLLY_MERGE_H_
#pragma once
#include <algorithm>
......@@ -82,5 +81,3 @@ OutputIt merge(InputIt1 first1, InputIt1 last1,
}
}
#endif
......@@ -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<class V> bool operator> (const V& other, const Optional<V>&) = delete;
///////////////////////////////////////////////////////////////////////////////
} // namespace folly
#endif // FOLLY_OPTIONAL_H_
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_PACKEDSYNCPTR_H_
#define FOLLY_PACKEDSYNCPTR_H_
#pragma once
#include <folly/Portability.h>
......@@ -147,5 +146,3 @@ static_assert(sizeof(PackedSyncPtr<void>) == 8,
"messed up");
}
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_PADDED_H_
#define FOLLY_PADDED_H_
#pragma once
#include <algorithm>
#include <cassert>
......@@ -512,5 +511,3 @@ class Adaptor {
} // namespace padded
} // namespace folly
#endif /* FOLLY_PADDED_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_PORTABILITY_H_
#define FOLLY_PORTABILITY_H_
#pragma once
#include <string.h>
......@@ -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_
......@@ -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_
......@@ -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 <atomic>
#include <cassert>
......@@ -174,5 +173,3 @@ private:
};
}
#endif
......@@ -81,8 +81,7 @@
* @author Xin Liu <xliux@fb.com>
*/
#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_
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_RANDOM_H_
#pragma once
#define FOLLY_RANDOM_H_
#include <type_traits>
......@@ -245,5 +245,3 @@ inline uint32_t randomNumberSeed() {
}
#include <folly/Random-inl.h>
#endif
......@@ -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 <folly/FBString.h>
#include <folly/Portability.h>
......@@ -1147,5 +1146,3 @@ struct hasher<folly::Range<T*>,
#pragma GCC diagnostic pop
FOLLY_ASSUME_FBVECTOR_COMPATIBLE_1(folly::Range);
#endif // FOLLY_RANGE_H_
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_SAFEASSERT_H_
#define FOLLY_SAFEASSERT_H_
#pragma once
#include <folly/Portability.h>
#include <folly/Preprocessor.h>
......@@ -50,5 +49,3 @@ namespace folly { namespace detail {
unsigned int line,
const char* function);
}} // namespace folly
#endif /* FOLLY_SAFEASSERT_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_SCOPEGUARD_H_
#define FOLLY_SCOPEGUARD_H_
#pragma once
#include <cstddef>
#include <functional>
......@@ -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_
......@@ -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 <folly/PicoSpinLock.h>
#endif
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_FAST_BYTE_SET_H_
#define FOLLY_FAST_BYTE_SET_H_
#pragma once
#include <cstdint>
#include <glog/logging.h>
......@@ -86,5 +85,3 @@ class SparseByteSet {
};
}
#endif
......@@ -42,8 +42,7 @@
// slower than MD5.
//
#ifndef FOLLY_SPOOKYHASHV1_H_
#define FOLLY_SPOOKYHASHV1_H_
#pragma once
#include <cstddef>
#include <cstdint>
......@@ -302,5 +301,3 @@ private:
} // namespace hash
} // namespace folly
#endif
......@@ -43,8 +43,7 @@
// slower than MD5.
//
#ifndef FOLLY_SPOOKYHASHV2_H_
#define FOLLY_SPOOKYHASHV2_H_
#pragma once
#include <cstddef>
#include <cstdint>
......@@ -307,5 +306,3 @@ private:
} // namespace hash
} // namespace folly
#endif
......@@ -14,13 +14,12 @@
* limitations under the License.
*/
#ifndef FOLLY_STRING_INL_H_
#define FOLLY_STRING_INL_H_
#pragma once
#include <stdexcept>
#include <iterator>
#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_ */
......@@ -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 <exception>
#include <stdarg.h>
......@@ -628,5 +628,3 @@ struct has_nothrow_constructor<folly::basic_fbstring<T> > : true_type {
} // namespace boost
#include <folly/String-inl.h>
#endif
......@@ -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 <sys/types.h>
#include <signal.h>
......@@ -869,5 +869,3 @@ inline Subprocess::Options& Subprocess::Options::operator|=(
}
} // namespace folly
#endif /* FOLLY_SUBPROCESS_H_ */
......@@ -21,8 +21,7 @@
* @author: Andrei Alexandrescu (andrei.alexandrescu@fb.com)
*/
#ifndef SYNCHRONIZED_H_
#define SYNCHRONIZED_H_
#pragma once
#include <type_traits>
#include <mutex>
......@@ -762,5 +761,3 @@ void lockInOrder(P1& p1, P2& p2) {
else
} /* namespace folly */
#endif // SYNCHRONIZED_H_
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_THREADCACHEDARENA_H_
#define FOLLY_THREADCACHEDARENA_H_
#pragma once
#include <type_traits>
......@@ -86,5 +85,3 @@ template <>
struct IsArenaAllocator<ThreadCachedArena> : std::true_type { };
} // namespace folly
#endif /* FOLLY_THREADCACHEDARENA_H_ */
......@@ -20,8 +20,7 @@
* @author Spencer Ahrens (sahrens)
*/
#ifndef FOLLY_THREADCACHEDINT_H
#define FOLLY_THREADCACHEDINT_H
#pragma once
#include <atomic>
......@@ -175,5 +174,3 @@ class ThreadCachedInt : boost::noncopyable {
};
}
#endif
......@@ -34,8 +34,7 @@
* @author Spencer Ahrens (sahrens)
*/
#ifndef FOLLY_THREADLOCAL_H_
#define FOLLY_THREADLOCAL_H_
#pragma once
#include <folly/Portability.h>
#include <boost/iterator/iterator_facade.hpp>
......@@ -353,5 +352,3 @@ class ThreadLocalPtr {
};
} // namespace folly
#endif /* FOLLY_THREADLOCAL_H_ */
......@@ -25,8 +25,7 @@
* @author Tudor Bosman (tudorb@fb.com)
*/
#ifndef FOLLY_TIMEOUTQUEUE_H_
#define FOLLY_TIMEOUTQUEUE_H_
#pragma once
#include <stdint.h>
#include <functional>
......@@ -127,5 +126,3 @@ class TimeoutQueue {
};
} // namespace folly
#endif /* FOLLY_TIMEOUTQUEUE_H_ */
......@@ -16,8 +16,7 @@
// @author: Andrei Alexandrescu
#ifndef FOLLY_BASE_TRAITS_H_
#define FOLLY_BASE_TRAITS_H_
#pragma once
#include <memory>
#include <limits>
......@@ -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_
......@@ -16,8 +16,7 @@
// Some utility routines relating to unicode.
#ifndef FOLLY_UNICODE_H_
#define FOLLY_UNICODE_H_
#pragma once
#include <folly/FBString.h>
......@@ -35,5 +34,3 @@ fbstring codePointToUtf8(char32_t cp);
//////////////////////////////////////////////////////////////////////
}
#endif
......@@ -14,7 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_URI_H_
#pragma once
#define FOLLY_URI_H_
#include <folly/String.h>
......@@ -119,5 +119,3 @@ class Uri {
} // namespace folly
#include <folly/Uri-inl.h>
#endif /* FOLLY_URI_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_VARINT_H_
#define FOLLY_VARINT_H_
#pragma once
#include <type_traits>
#include <folly/Conv.h>
......@@ -138,5 +137,3 @@ inline uint64_t decodeVarint(Range<T*>& data) {
}
} // namespaces
#endif /* FOLLY_VARINT_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_VERSIONCHECK_H_
#define FOLLY_VERSIONCHECK_H_
#pragma once
#include <cstdio>
#include <cstdlib>
......@@ -107,5 +106,3 @@
} \
} \
}
#endif /* FOLLY_VERSIONCHECK_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 <thread>
#include <folly/portability/Asm.h>
......@@ -38,5 +37,3 @@ void atomic_hash_spin_wait(Cond condition) {
}
}} // namespace folly::detail
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_BITITERATORDETAIL_H_
#define FOLLY_DETAIL_BITITERATORDETAIL_H_
#pragma once
#include <iterator>
#include <type_traits>
......@@ -88,5 +87,3 @@ struct BitIteratorBase {
} // namespace bititerator_detail
} // namespace folly
#endif /* FOLLY_DETAIL_BITITERATORDETAIL_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_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_CACHELOCALITY_H_
#define FOLLY_DETAIL_CACHELOCALITY_H_
#pragma once
#include <sched.h>
#include <algorithm>
......@@ -346,5 +345,3 @@ Getcpu::Func AccessSpreader<std::atomic>::pickGetcpuFunc();
} // namespace detail
} // namespace folly
#endif /* FOLLY_DETAIL_CacheLocality_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_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_DISCRIMINATEDPTRDETAIL_H_
#define FOLLY_DETAIL_DISCRIMINATEDPTRDETAIL_H_
#pragma once
#include <utility>
#include <type_traits>
......@@ -161,5 +160,3 @@ struct ApplyConstVisitor
} // namespace dptr_detail
} // namespace folly
#endif /* FOLLY_DETAIL_DISCRIMINATEDPTRDETAIL_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
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_FILEUTILDETAIL_H_
#define FOLLY_DETAIL_FILEUTILDETAIL_H_
#pragma once
#include <cerrno>
#include <unistd.h>
......@@ -107,5 +106,3 @@ ssize_t wrapvFull(F f, int fd, iovec* iov, int count, Offset... offset) {
}
}} // namespaces
#endif /* FOLLY_DETAIL_FILEUTILDETAIL_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_BUILD_FINGERPRINTPOLYNOMIAL_H_
#define FOLLY_BUILD_FINGERPRINTPOLYNOMIAL_H_
#pragma once
#include <cstdint>
......@@ -141,5 +140,3 @@ class FingerprintPolynomial {
} // namespace detail
} // namespace folly
#endif /* FOLLY_BUILD_FINGERPRINTPOLYNOMIAL_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_FUNCTIONAL_EXCEPT_H
#define FOLLY_DETAIL_FUNCTIONAL_EXCEPT_H
#pragma once
#include <folly/Portability.h>
......@@ -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
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_GROUPVARINTDETAIL_H_
#define FOLLY_DETAIL_GROUPVARINTDETAIL_H_
#pragma once
#include <stddef.h>
......@@ -99,5 +98,3 @@ class GroupVarintBase {
} // namespace detail
} // namespace folly
#endif /* FOLLY_DETAIL_GROUPVARINTDETAIL_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_MALLOC_H
#define FOLLY_DETAIL_MALLOC_H
#pragma once
#include <stdlib.h>
......@@ -84,5 +83,3 @@ extern int (*mallctlbymib)(const size_t*, size_t, void*, size_t*, void*,
#endif
}
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_MEMORYIDLER_H
#define FOLLY_DETAIL_MEMORYIDLER_H
#pragma once
#include <atomic>
#include <chrono>
......@@ -149,5 +148,3 @@ struct MemoryIdler {
};
}} // namespace folly::detail
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_RANGE_COMMON_H_
#define FOLLY_DETAIL_RANGE_COMMON_H_
#pragma once
#include <algorithm>
#include <string>
......@@ -86,5 +85,3 @@ inline size_t qfind_first_byte_of_nosse(const StringPieceLite haystack,
}
}
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_RANGE_SSE42_H_
#define FOLLY_DETAIL_RANGE_SSE42_H_
#pragma once
#include <cstddef>
#include <folly/detail/RangeCommon.h>
......@@ -30,5 +29,3 @@ size_t qfind_first_byte_of_sse42(const StringPieceLite haystack,
}
}
#endif
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_SLOWFINGERPRINT_H_
#define FOLLY_DETAIL_SLOWFINGERPRINT_H_
#pragma once
#include <folly/Fingerprint.h>
#include <folly/detail/FingerprintPolynomial.h>
......@@ -88,5 +87,3 @@ class SlowFingerprint {
} // namespace detail
} // namespace folly
#endif /* FOLLY_DETAIL_SLOWFINGERPRINT_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_STATS_H_
#define FOLLY_DETAIL_STATS_H_
#pragma once
#include <chrono>
#include <cstdint>
......@@ -123,5 +122,3 @@ struct Bucket {
};
}} // folly::detail
#endif // FOLLY_DETAIL_STATS_H_
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_THREADLOCALDETAIL_H_
#define FOLLY_DETAIL_THREADLOCALDETAIL_H_
#pragma once
#include <limits.h>
#include <pthread.h>
......@@ -359,5 +358,3 @@ struct StaticMeta : StaticMetaBase {
} // namespace threadlocal_detail
} // namespace folly
#endif /* FOLLY_DETAIL_THREADLOCALDETAIL_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DETAIL_UNCAUGHTEXCEPTIONCOUNTER_H_
#define FOLLY_DETAIL_UNCAUGHTEXCEPTIONCOUNTER_H_
#pragma once
#include <exception>
......@@ -93,5 +92,3 @@ inline int UncaughtExceptionCounter::getUncaughtExceptionCount() noexcept {
}
}} // namespaces
#endif /* FOLLY_DETAIL_UNCAUGHTEXCEPTIONCOUNTER_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_DYNAMIC_INL_H_
#define FOLLY_DYNAMIC_INL_H_
#pragma once
#include <functional>
#include <boost/iterator/iterator_adaptor.hpp>
......@@ -874,5 +873,3 @@ class FormatValue<detail::DefaultValueWrapper<dynamic, V>> {
} // namespaces
#undef FB_DYNAMIC_APPLY
#endif
......@@ -60,8 +60,7 @@
* @author Jordan DeLong <delong.j@fb.com>
*/
#ifndef FOLLY_DYNAMIC_H_
#define FOLLY_DYNAMIC_H_
#pragma once
#include <cstdint>
#include <initializer_list>
......@@ -588,5 +587,3 @@ private:
}
#include <folly/dynamic-inl.h>
#endif
......@@ -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 <cstdlib>
#include <limits>
......@@ -448,5 +447,3 @@ class BitVectorReader {
};
}} // namespaces
#endif // FOLLY_EXPERIMENTAL_BIT_VECTOR_CODING_H
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_EXPERIMENTAL_BITS_H_
#define FOLLY_EXPERIMENTAL_BITS_H_
#pragma once
#include <cstddef>
#include <type_traits>
......@@ -304,5 +303,3 @@ inline size_t Bits<T, Traits>::count(const T* begin, const T* end) {
}
} // namespace folly
#endif /* FOLLY_EXPERIMENTAL_BITS_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 <cstdlib>
#include <limits>
......@@ -684,5 +683,3 @@ class EliasFanoReader {
};
}} // namespaces
#endif // FOLLY_EXPERIMENTAL_ELIAS_FANO_CODING_H
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_EXPERIMENTAL_EVENTCOUNT_H_
#define FOLLY_EXPERIMENTAL_EVENTCOUNT_H_
#pragma once
#include <unistd.h>
#include <syscall.h>
......@@ -210,5 +209,3 @@ void EventCount::await(Condition condition) {
}
} // namespace folly
#endif /* FOLLY_EXPERIMENTAL_EVENTCOUNT_H_ */
......@@ -14,8 +14,7 @@
* limitations under the License.
*/
#ifndef FOLLY_EXPERIMENTAL_FUNCTION_SCHEDULER_H_
#define FOLLY_EXPERIMENTAL_FUNCTION_SCHEDULER_H_
#pragma once
#include <folly/Range.h>
#include <chrono>
......@@ -263,5 +262,3 @@ class FunctionScheduler {
};
}
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment