build: avoid double underscore header guards

This commit is contained in:
Danny Robson 2021-04-14 15:35:49 +10:00
parent f330b840e0
commit 92afaf38ec
38 changed files with 61 additions and 181 deletions

View File

@ -6,9 +6,7 @@
* Copyright 2016 Danny Robson <danny@nerdcruft.net> * Copyright 2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_ALLOC_FWD_HPP #pragma once
#define __UTIL_ALLOC_FWD_HPP
namespace cruft::alloc { namespace cruft::alloc {
namespace raw { namespace raw {
@ -31,5 +29,3 @@ namespace cruft::alloc {
template <typename T> class arena; template <typename T> class arena;
template <typename B, typename T> class allocator; template <typename B, typename T> class allocator;
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015-2016 Danny Robson <danny@nerdcruft.net> * Copyright 2015-2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_BEZIER_HPP #pragma once
#define __UTIL_BEZIER_HPP
#include "point.hpp" #include "point.hpp"
#include "region.hpp" #include "region.hpp"
@ -73,5 +72,3 @@ namespace cruft {
template <size_t N> template <size_t N>
std::ostream& operator<< (std::ostream&, const bezier<N>&); std::ostream& operator<< (std::ostream&, const bezier<N>&);
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2010-2017 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2017 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_COLOUR_HPP #pragma once
#define __UTIL_COLOUR_HPP
#include "coord.hpp" #include "coord.hpp"
@ -121,5 +120,3 @@ namespace cruft {
template <typename T> template <typename T>
constexpr auto is_colour_v = is_colour<T>::value; constexpr auto is_colour_v = is_colour<T>::value;
} }
#endif

View File

@ -6,10 +6,7 @@
* Copyright 2012-2015 Danny Robson <danny@nerdcruft.net> * Copyright 2012-2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_COORD_HPP #pragma once
#define __UTIL_COORD_HPP
#include "coord/base.hpp" #include "coord/base.hpp"
#include "coord/ops.hpp" #include "coord/ops.hpp"
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2010-2012 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2012 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_EXE_HPP #pragma once
#define __UTIL_EXE_HPP
#include <filesystem> #include <filesystem>
@ -15,5 +14,3 @@ namespace cruft {
/// Returns a path to the current executable. /// Returns a path to the current executable.
std::filesystem::path image_path (void); std::filesystem::path image_path (void);
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2011-2016 Danny Robson <danny@nerdcruft.net> * Copyright 2011-2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __FLOAT_HPP #pragma once
#define __FLOAT_HPP
#include "types/sized.hpp" #include "types/sized.hpp"
@ -77,4 +76,3 @@ namespace cruft {
static_assert (sizeof(ieee_single ) == 4, "ieee_single must be 4 bytes"); static_assert (sizeof(ieee_single ) == 4, "ieee_single must be 4 bytes");
static_assert (sizeof(ieee_double ) == 8, "ieee_double must be 8 bytes"); static_assert (sizeof(ieee_double ) == 8, "ieee_double must be 8 bytes");
} }
#endif // __FLOAT_HPP

View File

@ -6,8 +6,7 @@
* Copyright 2011 Danny Robson <danny@nerdcruft.net> * Copyright 2011 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_FOURCC_HPP #pragma once
#define __UTIL_FOURCC_HPP
#include <iosfwd> #include <iosfwd>
#include <cstdint> #include <cstdint>
@ -25,6 +24,3 @@ namespace cruft {
std::ostream& operator<< (std::ostream&, cruft::fourcc); std::ostream& operator<< (std::ostream&, cruft::fourcc);
} }
#endif

View File

@ -6,11 +6,8 @@
* Copyright 2010 Danny Robson <danny@nerdcruft.net> * Copyright 2010 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_GCC_HPP #pragma once
#define __UTIL_GCC_HPP
#define GCC_VERSION (__GNUC__ * 10000 + \ #define GCC_VERSION (__GNUC__ * 10000 + \
__GNUC_MINOR__ * 100 + \ __GNUC_MINOR__ * 100 + \
__GNUC_PATCHLEVEL__) __GNUC_PATCHLEVEL__)
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_GEOM_CYLINDER_HPP #pragma once
#define __UTIL_GEOM_CYLINDER_HPP
#include "../point.hpp" #include "../point.hpp"
@ -24,5 +23,3 @@ namespace cruft::geom {
using cylinder3f = cylinder<3,float>; using cylinder3f = cylinder<3,float>;
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015-2018 Danny Robson <danny@nerdcruft.net> * Copyright 2015-2018 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_GEOM_SPHERE_HPP #pragma once
#define __UTIL_GEOM_SPHERE_HPP
#include "../point.hpp" #include "../point.hpp"
@ -53,5 +52,3 @@ namespace cruft::geom {
INFINITY; INFINITY;
} }
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2010-2014 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2014 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_HASH_ADLER_HPP #pragma once
#define __UTIL_HASH_ADLER_HPP
#include "fletcher.hpp" #include "fletcher.hpp"
@ -21,5 +20,3 @@ namespace cruft::hash {
adler32 (); adler32 ();
}; };
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_HASH_FASTHASH_HPP #pragma once
#define __UTIL_HASH_FASTHASH_HPP
#include "../view.hpp" #include "../view.hpp"
@ -35,5 +34,3 @@ namespace cruft::hash {
digest_t operator() (uint64_t seed, cruft::view<const uint8_t*>) const; digest_t operator() (uint64_t seed, cruft::view<const uint8_t*>) const;
}; };
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2010-2015 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_HASH_FNV1A_HPP #pragma once
#define __UTIL_HASH_FNV1A_HPP
#include "view.hpp" #include "view.hpp"
@ -23,5 +22,3 @@ namespace cruft::hash {
digest_t operator() (cruft::view<const uint8_t*>) const noexcept; digest_t operator() (cruft::view<const uint8_t*>) const noexcept;
}; };
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2016, Danny Robson <danny@nerdcruft.net> * Copyright 2016, Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_HASH_FWD_HPP #pragma once
#define __UTIL_HASH_FWD_HPP
// The single function call hashes are light weight enough to include // The single function call hashes are light weight enough to include
// directly, and are unlikely to change given their inherent // directly, and are unlikely to change given their inherent
@ -30,5 +29,3 @@ namespace cruft::hash {
class xxhash; class xxhash;
} }
#endif

View File

@ -6,11 +6,8 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_HASH_MURMUR_HPP #pragma once
#define __UTIL_HASH_MURMUR_HPP
#include "murmur/murmur1.hpp" #include "murmur/murmur1.hpp"
#include "murmur/murmur2.hpp" #include "murmur/murmur2.hpp"
#include "murmur/murmur3.hpp" #include "murmur/murmur3.hpp"
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_HASH_MURMUR_MURMUR1_HPP #pragma once
#define __UTIL_HASH_MURMUR_MURMUR1_HPP
#include "../../view.hpp" #include "../../view.hpp"
@ -42,5 +41,3 @@ namespace cruft::hash {
seed_t m_seed; seed_t m_seed;
}; };
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_HASH_MURMUR_MURMUR2_HPP #pragma once
#define __UTIL_HASH_MURMUR_MURMUR2_HPP
#include "../../view.hpp" #include "../../view.hpp"
@ -80,6 +79,3 @@ namespace cruft::hash {
seed_t m_seed; seed_t m_seed;
}; };
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_HASH_MURMUR_MURMUR3_HPP #pragma once
#define __UTIL_HASH_MURMUR_MURMUR3_HPP
#include "../../view.hpp" #include "../../view.hpp"
@ -51,6 +50,3 @@ namespace cruft::hash {
using murmur3_128_x86 = murmur3<128,32>; using murmur3_128_x86 = murmur3<128,32>;
using murmur3_128_x64 = murmur3<128,64>; using murmur3_128_x64 = murmur3<128,64>;
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2010-2015 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_HASH_WANG_HPP #pragma once
#define __UTIL_HASH_WANG_HPP
#include <cstdint> #include <cstdint>
@ -45,5 +44,3 @@ namespace cruft::hash {
return key; return key;
} }
} }
#endif

5
io.hpp
View File

@ -6,8 +6,7 @@
* Copyright 2010-2014 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2014 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_IO_HPP #pragma once
#define __UTIL_IO_HPP
#include "std.hpp" #include "std.hpp"
#include "platform.hpp" #include "platform.hpp"
@ -231,5 +230,3 @@ namespace cruft {
#else #else
#include "io_posix.hpp" #include "io_posix.hpp"
#endif #endif
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2010-2016 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_IO_POSIX_HPP #pragma once
#define __UTIL_IO_POSIX_HPP
#include "posix/fd.hpp" #include "posix/fd.hpp"
@ -82,5 +81,3 @@ namespace cruft {
typedef detail::posix::mapped_file mapped_file; typedef detail::posix::mapped_file mapped_file;
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_LIBRARY_HPP #pragma once
#define __UTIL_LIBRARY_HPP
#include "platform.hpp" #include "platform.hpp"
@ -16,5 +15,3 @@
#elif defined(PLATFORM_WIN32) #elif defined(PLATFORM_WIN32)
#include "library_win32.hpp" #include "library_win32.hpp"
#endif #endif
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_LIBRARY_POSIX_HPP #pragma once
#define __UTIL_LIBRARY_POSIX_HPP
#include <filesystem> #include <filesystem>
@ -41,5 +40,3 @@ namespace cruft {
typedef detail::library_posix library; typedef detail::library_posix library;
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_LIBRARY_WIN32_HPP #pragma once
#define __UTIL_LIBRARY_WIN32_HPP
#include "win32/windows.hpp" #include "win32/windows.hpp"
@ -46,5 +45,3 @@ namespace cruft {
typedef detail::win32::library library; typedef detail::win32::library library;
} }
#endif

View File

@ -6,13 +6,10 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_MEMORY_SYSTEM_HPP #pragma once
#define __UTIL_MEMORY_SYSTEM_HPP
#include <cstddef> #include <cstddef>
namespace cruft::memory { namespace cruft::memory {
size_t pagesize (void); size_t pagesize (void);
} }
#endif

View File

@ -6,13 +6,10 @@
* Copyright 2016 Danny Robson <danny@nerdcruft.net> * Copyright 2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __CRUFT_UTIL_POSIX_FWD_HPP #pragma once
#define __CRUFT_UTIL_POSIX_FWD_HPP
namespace cruft::posix { namespace cruft::posix {
class fd; class fd;
class dir; class dir;
class map; class map;
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2016 Danny Robson <danny@nerdcruft.net> * Copyright 2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __CRUFT_UTIL_POSIX_HPP #pragma once
#define __CRUFT_UTIL_POSIX_HPP
#include "fd.hpp" #include "fd.hpp"
@ -51,5 +50,3 @@ namespace cruft::posix {
size_t m_size; size_t m_size;
}; };
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2011-2018 Danny Robson <danny@nerdcruft.net> * Copyright 2011-2018 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_QUATERNION_HPP #pragma once
#define __UTIL_QUATERNION_HPP
#include "coord/traits.hpp" #include "coord/traits.hpp"
@ -256,5 +255,3 @@ namespace cruft {
std::ostream& std::ostream&
operator<< (std::ostream&, quaternion<T>); operator<< (std::ostream&, quaternion<T>);
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2014-2015 Danny Robson <danny@nerdcruft.net> * Copyright 2014-2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_RATIONAL_HPP #pragma once
#define __UTIL_RATIONAL_HPP
#include <type_traits> #include <type_traits>
#include <iosfwd> #include <iosfwd>
@ -67,6 +66,3 @@ namespace cruft {
template <typename ValueT> template <typename ValueT>
std::ostream& operator<< (std::ostream&, rational<ValueT>); std::ostream& operator<< (std::ostream&, rational<ValueT>);
}; };
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2016 Danny Robson <danny@nerdcruft.net> * Copyright 2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_ROOTS_BISECTION_HPP #pragma once
#define __UTIL_ROOTS_BISECTION_HPP
#include "../maths.hpp" #include "../maths.hpp"
@ -57,5 +56,3 @@ namespace cruft::roots {
return (a + b) / T{2}; return (a + b) / T{2};
} }
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2010 Danny Robson <danny@nerdcruft.net> * Copyright 2010 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_STATS_HPP #pragma once
#define __UTIL_STATS_HPP
#include <iosfwd> #include <iosfwd>
@ -39,5 +38,3 @@ namespace cruft {
std::ostream& operator<< (std::ostream&, const accumulator<T>&); std::ostream& operator<< (std::ostream&, const accumulator<T>&);
} }
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2011-2016 Danny Robson <danny@nerdcruft.net> * Copyright 2011-2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_STREAM_HPP #pragma once
#define __UTIL_STREAM_HPP
#include <iosfwd> #include <iosfwd>
#include <cstdint> #include <cstdint>
@ -76,6 +75,3 @@ namespace cruft::stream {
//--------------------------------------------------------------------- //---------------------------------------------------------------------
std::ostream& operator<< (std::ostream&, bits); std::ostream& operator<< (std::ostream&, bits);
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2016 Danny Robson <danny@nerdcruft.net> * Copyright 2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_TERM_HPP #pragma once
#define __UTIL_TERM_HPP
#include <iosfwd> #include <iosfwd>
@ -56,5 +55,3 @@ namespace cruft::term {
std::ostream& operator<< (std::ostream&, graphics); std::ostream& operator<< (std::ostream&, graphics);
} }
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2010-2016 Danny Robson <danny@nerdcruft.net> * Copyright 2010-2016 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_TIME_HPP #pragma once
#define __UTIL_TIME_HPP
#include "stats.hpp" #include "stats.hpp"
@ -93,5 +92,3 @@ namespace cruft {
stats::accumulator<uint64_t> m_series; stats::accumulator<uint64_t> m_series;
}; };
} }
#endif

View File

@ -6,13 +6,10 @@
* Copyright 2011 Danny Robson <danny@nerdcruft.net> * Copyright 2011 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_TYPES_STRING_HPP #pragma once
#define __UTIL_TYPES_STRING_HPP
#include <string> #include <string>
template <typename T> template <typename T>
std::string std::string
type_to_string (void); type_to_string (void);
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2010 Danny Robson <danny@nerdcruft.net> * Copyright 2010 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_VERSION_HPP #pragma once
#define __UTIL_VERSION_HPP
#include <array> #include <array>
#include <string> #include <string>
@ -90,6 +89,3 @@ namespace cruft {
std::ostream& operator<< (std::ostream& os, const cruft::version& rhs); std::ostream& operator<< (std::ostream& os, const cruft::version& rhs);
} }
#endif // __VERSION_HPP

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net> * Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_WIN32_REGISTRY_HPP #pragma once
#define __UTIL_WIN32_REGISTRY_HPP
#include "windows.hpp" #include "windows.hpp"
@ -60,5 +59,3 @@ namespace cruft::win32 {
HKEY m_handle; HKEY m_handle;
}; };
} }
#endif

View File

@ -6,8 +6,7 @@
* Copyright 2013 Danny Robson <danny@nerdcruft.net> * Copyright 2013 Danny Robson <danny@nerdcruft.net>
*/ */
#ifndef __UTIL_ZLIB_HPP #pragma once
#define __UTIL_ZLIB_HPP
#include <stdexcept> #include <stdexcept>
#include <string> #include <string>
@ -60,5 +59,3 @@ namespace cruft {
}; };
} }
} }
#endif