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>
*/
#ifndef __UTIL_ALLOC_FWD_HPP
#define __UTIL_ALLOC_FWD_HPP
#pragma once
namespace cruft::alloc {
namespace raw {
@ -31,5 +29,3 @@ namespace cruft::alloc {
template <typename T> class arena;
template <typename B, typename T> class allocator;
}
#endif

View File

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

View File

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

View File

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

View File

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

View File

@ -6,8 +6,7 @@
* Copyright 2011-2016 Danny Robson <danny@nerdcruft.net>
*/
#ifndef __FLOAT_HPP
#define __FLOAT_HPP
#pragma once
#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_double ) == 8, "ieee_double must be 8 bytes");
}
#endif // __FLOAT_HPP

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,8 +6,7 @@
* Copyright 2015 Danny Robson <danny@nerdcruft.net>
*/
#ifndef __UTIL_HASH_FASTHASH_HPP
#define __UTIL_HASH_FASTHASH_HPP
#pragma once
#include "../view.hpp"
@ -34,6 +33,4 @@ namespace cruft::hash {
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>
*/
#ifndef __UTIL_HASH_FNV1A_HPP
#define __UTIL_HASH_FNV1A_HPP
#pragma once
#include "view.hpp"
@ -22,6 +21,4 @@ namespace cruft::hash {
digest_t operator() (cruft::view<const uint8_t*>) const noexcept;
};
}
#endif
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

7
io.hpp
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,8 +6,7 @@
* Copyright 2010 Danny Robson <danny@nerdcruft.net>
*/
#ifndef __UTIL_VERSION_HPP
#define __UTIL_VERSION_HPP
#pragma once
#include <array>
#include <string>
@ -89,7 +88,4 @@ namespace cruft {
};
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>
*/
#ifndef __UTIL_WIN32_REGISTRY_HPP
#define __UTIL_WIN32_REGISTRY_HPP
#pragma once
#include "windows.hpp"
@ -60,5 +59,3 @@ namespace cruft::win32 {
HKEY m_handle;
};
}
#endif

View File

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