diff options
| author | Martin Ridgers <[email protected]> | 2021-09-16 17:08:01 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-09-16 17:08:01 +0200 |
| commit | 8da2c13a34fd6394aecaf19490d65a8a84592e3c (patch) | |
| tree | 702cb3aec8145209fb5d8e39d8bf6d1432dd1a33 /zencore/include | |
| parent | Another missing include (diff) | |
| parent | Compact binary package caching support (#9) (diff) | |
| download | zen-8da2c13a34fd6394aecaf19490d65a8a84592e3c.tar.xz zen-8da2c13a34fd6394aecaf19490d65a8a84592e3c.zip | |
Merge main into linux-mac
Diffstat (limited to 'zencore/include')
| -rw-r--r-- | zencore/include/zencore/atomic.h | 4 | ||||
| -rw-r--r-- | zencore/include/zencore/except.h | 2 | ||||
| -rw-r--r-- | zencore/include/zencore/intmath.h | 2 | ||||
| -rw-r--r-- | zencore/include/zencore/iobuffer.h | 16 | ||||
| -rw-r--r-- | zencore/include/zencore/memory.h | 10 | ||||
| -rw-r--r-- | zencore/include/zencore/session.h | 4 | ||||
| -rw-r--r-- | zencore/include/zencore/zencore.h | 51 |
7 files changed, 45 insertions, 44 deletions
diff --git a/zencore/include/zencore/atomic.h b/zencore/include/zencore/atomic.h index 7e261771b..bf549e21d 100644 --- a/zencore/include/zencore/atomic.h +++ b/zencore/include/zencore/atomic.h @@ -5,9 +5,9 @@ #include <zencore/zencore.h> #if ZEN_COMPILER_MSC -#include <intrin.h> +# include <intrin.h> #else -#include <atomic> +# include <atomic> #endif #include <cinttypes> diff --git a/zencore/include/zencore/except.h b/zencore/include/zencore/except.h index 90f7d45db..f0e04a795 100644 --- a/zencore/include/zencore/except.h +++ b/zencore/include/zencore/except.h @@ -51,7 +51,7 @@ private: }; ZENCORE_API void ThrowSystemException(HRESULT hRes, std::string_view Message); -#endif // ZEN_PLATFORM_WINDOWS +#endif // ZEN_PLATFORM_WINDOWS ZENCORE_API void ThrowLastError(std::string_view Message); diff --git a/zencore/include/zencore/intmath.h b/zencore/include/zencore/intmath.h index 2fdea22b5..7619e1950 100644 --- a/zencore/include/zencore/intmath.h +++ b/zencore/include/zencore/intmath.h @@ -179,6 +179,6 @@ Max(auto x, auto y) ////////////////////////////////////////////////////////////////////////// -void intmath_forcelink(); // internal +void intmath_forcelink(); // internal } // namespace zen diff --git a/zencore/include/zencore/iobuffer.h b/zencore/include/zencore/iobuffer.h index f3120983e..298952dd6 100644 --- a/zencore/include/zencore/iobuffer.h +++ b/zencore/include/zencore/iobuffer.h @@ -15,14 +15,14 @@ struct IoBufferExtendedCore; enum class ZenContentType : uint8_t { - kBinary = 0, // Note that since this is zero, this will be the default value in IoBuffer - kText = 1, - kJSON = 2, - kCbObject = 3, - kCbPackage = 4, - kYAML = 5, - kCbPackageOffer = 6, - kCompressedBinary = 7, + kBinary = 0, // Note that since this is zero, this will be the default value in IoBuffer + kText = 1, + kJSON = 2, + kCbObject = 3, + kCbPackage = 4, + kYAML = 5, + kCbPackageOffer = 6, + kCompressedBinary = 7, kUnknownContentType = 8, kCOUNT }; diff --git a/zencore/include/zencore/memory.h b/zencore/include/zencore/memory.h index 9d6339595..3d4db1081 100644 --- a/zencore/include/zencore/memory.h +++ b/zencore/include/zencore/memory.h @@ -83,7 +83,7 @@ struct MutableMemoryView { } - inline bool IsEmpty() const { return m_Data == m_DataEnd; } + inline bool IsEmpty() const { return m_Data == m_DataEnd; } void* GetData() const { return m_Data; } void* GetDataEnd() const { return m_DataEnd; } size_t GetSize() const { return reinterpret_cast<uint8_t*>(m_DataEnd) - reinterpret_cast<uint8_t*>(m_Data); } @@ -194,10 +194,10 @@ struct MemoryView { } - inline bool Contains(const MemoryView& Other) const { return (m_Data <= Other.m_Data) && (m_DataEnd >= Other.m_DataEnd); } - inline bool IsEmpty() const { return m_Data == m_DataEnd; } - const void* GetData() const { return m_Data; } - const void* GetDataEnd() const { return m_DataEnd; } + inline bool Contains(const MemoryView& Other) const { return (m_Data <= Other.m_Data) && (m_DataEnd >= Other.m_DataEnd); } + inline bool IsEmpty() const { return m_Data == m_DataEnd; } + const void* GetData() const { return m_Data; } + const void* GetDataEnd() const { return m_DataEnd; } size_t GetSize() const { return reinterpret_cast<const uint8_t*>(m_DataEnd) - reinterpret_cast<const uint8_t*>(m_Data); } inline bool operator==(const MemoryView& Rhs) const { return m_Data == Rhs.m_Data && m_DataEnd == Rhs.m_DataEnd; } diff --git a/zencore/include/zencore/session.h b/zencore/include/zencore/session.h index e66794704..2da41b2c8 100644 --- a/zencore/include/zencore/session.h +++ b/zencore/include/zencore/session.h @@ -1,3 +1,5 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + #pragma once #include <zencore/zencore.h> @@ -8,4 +10,4 @@ struct Oid; ZENCORE_API Oid GetSessionId(); -} +} // namespace zen diff --git a/zencore/include/zencore/zencore.h b/zencore/include/zencore/zencore.h index 73446b447..54df7e85e 100644 --- a/zencore/include/zencore/zencore.h +++ b/zencore/include/zencore/zencore.h @@ -10,39 +10,39 @@ // Platform // -#define ZEN_PLATFORM_WINDOWS 0 -#define ZEN_PLATFORM_LINUX 0 -#define ZEN_PLATFORM_MACOS 0 +#define ZEN_PLATFORM_WINDOWS 0 +#define ZEN_PLATFORM_LINUX 0 +#define ZEN_PLATFORM_MACOS 0 #ifdef _WIN32 -# undef ZEN_PLATFORM_WINDOWS -# define ZEN_PLATFORM_WINDOWS 1 +# undef ZEN_PLATFORM_WINDOWS +# define ZEN_PLATFORM_WINDOWS 1 #elif defined(__linux__) -# undef ZEN_PLATFORM_LINUX -# define ZEN_PLATFORM_LINUX 1 +# undef ZEN_PLATFORM_LINUX +# define ZEN_PLATFORM_LINUX 1 #elif defined(__APPLE__) -# undef ZEN_PLATFORM_MACOS -# define ZEN_PLATFORM_MACOS 1 +# undef ZEN_PLATFORM_MACOS +# define ZEN_PLATFORM_MACOS 1 #endif ////////////////////////////////////////////////////////////////////////// // Compiler // -#define ZEN_COMPILER_CLANG 0 -#define ZEN_COMPILER_MSC 0 -#define ZEN_COMPILER_GCC 0 +#define ZEN_COMPILER_CLANG 0 +#define ZEN_COMPILER_MSC 0 +#define ZEN_COMPILER_GCC 0 // Clang can define __GNUC__ and/or _MSC_VER so we check for Clang first #ifdef __clang__ -# undef ZEN_COMPILER_CLANG -# define ZEN_COMPILER_CLANG 1 +# undef ZEN_COMPILER_CLANG +# define ZEN_COMPILER_CLANG 1 #elif defined(_MSC_VER) -# undef ZEN_COMPILER_MSC -# define ZEN_COMPILER_MSC 1 +# undef ZEN_COMPILER_MSC +# define ZEN_COMPILER_MSC 1 #elif defined(__GNUC__) -# undef ZEN_COMPILER_GCC -# define ZEN_COMPILER_GCC 1 +# undef ZEN_COMPILER_GCC +# define ZEN_COMPILER_GCC 1 #else # error Unknown compiler #endif @@ -56,17 +56,16 @@ # endif #endif - ////////////////////////////////////////////////////////////////////////// // Architecture // #if defined(__amd64__) || defined(_M_X64) -# define ZEN_ARCH_X64 1 -# define ZEN_ARCH_ARM64 0 +# define ZEN_ARCH_X64 1 +# define ZEN_ARCH_ARM64 0 #elif defined(__arm64__) || defined(_M_ARM64) -# define ZEN_ARCH_X64 0 -# define ZEN_ARCH_ARM64 1 +# define ZEN_ARCH_X64 0 +# define ZEN_ARCH_ARM64 1 #else # error Unknown architecture #endif @@ -142,13 +141,13 @@ char (&ZenArrayCountHelper(const T (&)[N]))[N + 1]; ////////////////////////////////////////////////////////////////////////// #if ZEN_COMPILER_MSC -# define ZEN_NOINLINE __declspec(noinline) +# define ZEN_NOINLINE __declspec(noinline) #else -# define ZEN_NOINLINE __attribute__((noinline)) +# define ZEN_NOINLINE __attribute__((noinline)) #endif #define ZEN_UNUSED(...) ((void)__VA_ARGS__) -#define ZEN_NOT_IMPLEMENTED(...) ZEN_ASSERT(false) +#define ZEN_NOT_IMPLEMENTED(...) ZEN_ASSERT(false, __VA_ARGS__) #define ZENCORE_API // Placeholder to allow DLL configs in the future ZENCORE_API bool IsPointerToStack(const void* ptr); // Query if pointer is within the stack of the currently executing thread |