diff --git a/Utilities/BEType.h b/Utilities/BEType.h index 7fb9d35bb6..23bc07db7f 100644 --- a/Utilities/BEType.h +++ b/Utilities/BEType.h @@ -1,5 +1,4 @@ -#ifndef BETYPE_H_GUARD -#define BETYPE_H_GUARD +#pragma once // No BOM and only basic ASCII in this header, or a neko will die #include "types.h" #include "util/endian.hpp" @@ -510,5 +509,3 @@ struct fmt_unveil, void> static_assert(be_t(1) + be_t(2) + be_t(3) == 6); static_assert(le_t(1) + le_t(2) + le_t(3) == 6); - -#endif // BETYPE_H_GUARD diff --git a/Utilities/File.h b/Utilities/File.h index cdaa1085af..c4b53cd35c 100644 --- a/Utilities/File.h +++ b/Utilities/File.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once // No BOM and only basic ASCII in this header, or a neko will die #include "types.h" #include "bit_set.h" diff --git a/Utilities/StrFmt.h b/Utilities/StrFmt.h index 33b4b6473e..4a921d3b5f 100644 --- a/Utilities/StrFmt.h +++ b/Utilities/StrFmt.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once // No BOM and only basic ASCII in this header, or a neko will die #include "types.h" diff --git a/Utilities/types.h b/Utilities/types.h index c31b12f6c2..8f25f04e92 100644 --- a/Utilities/types.h +++ b/Utilities/types.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once // No BOM and only basic ASCII in this header, or a neko will die #ifdef _MSC_VER #include diff --git a/rpcs3/stdafx.cpp b/rpcs3/stdafx.cpp index fd4f341c7b..77f28c49f2 100644 --- a/rpcs3/stdafx.cpp +++ b/rpcs3/stdafx.cpp @@ -1 +1,5 @@ +// No BOM and only basic ASCII in this file, or a neko will die #include "stdafx.h" + +static_assert(be_t(1) + be_t(2) + be_t(3) == 6); +static_assert(le_t(1) + le_t(2) + le_t(3) == 6); diff --git a/rpcs3/stdafx.h b/rpcs3/stdafx.h index 09db940f08..1340faee02 100644 --- a/rpcs3/stdafx.h +++ b/rpcs3/stdafx.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once // No BOM and only basic ASCII in this header, or a neko will die #ifdef MSVC_CRT_MEMLEAK_DETECTION #define _CRTDBG_MAP_ALLOC diff --git a/rpcs3/util/atomic.hpp b/rpcs3/util/atomic.hpp index 5035c8808b..32e1a52b2b 100644 --- a/rpcs3/util/atomic.hpp +++ b/rpcs3/util/atomic.hpp @@ -1,4 +1,4 @@ -#pragma once +#pragma once // No BOM and only basic ASCII in this header, or a neko will die #include "Utilities/types.h" #include diff --git a/rpcs3/util/endian.hpp b/rpcs3/util/endian.hpp index a3d39b271c..b7cbcd913c 100644 --- a/rpcs3/util/endian.hpp +++ b/rpcs3/util/endian.hpp @@ -1,5 +1,4 @@ -#ifndef ENDIAN_HPP_GUARD -#define ENDIAN_HPP_GUARD +#pragma once // No BOM and only basic ASCII in this header, or a neko will die #include #include "Utilities/types.h" @@ -492,5 +491,3 @@ public: } }; } - -#endif // ENDIAN_HPP_GUARD diff --git a/rpcs3/util/logs.hpp b/rpcs3/util/logs.hpp index 0cc8828612..cd6891aa59 100644 --- a/rpcs3/util/logs.hpp +++ b/rpcs3/util/logs.hpp @@ -1,4 +1,4 @@ -#pragma once +#pragma once // No BOM and only basic ASCII in this header, or a neko will die #include #include diff --git a/rpcs3/util/shared_ptr.hpp b/rpcs3/util/shared_ptr.hpp index 7f31cc9db2..21b03e39e1 100644 --- a/rpcs3/util/shared_ptr.hpp +++ b/rpcs3/util/shared_ptr.hpp @@ -1,4 +1,4 @@ -#pragma once +#pragma once // No BOM and only basic ASCII in this header, or a neko will die #include #include @@ -9,10 +9,12 @@ namespace stx template constexpr bool is_same_ptr() noexcept { - // Should be possible if constexpr bit_cast is available? + // I would like to make it a trait if there is some trick. + // And believe it shall possible with constexpr bit_cast. // Otherwise I hope it will compile in null code anyway. const auto u = reinterpret_cast(0x11223344556); - return static_cast(u) == static_cast(u); + const volatile void* x = u; + return static_cast(u) == x; } // TODO