diff options
Diffstat (limited to 'src/common/bit_field.h')
| -rw-r--r-- | src/common/bit_field.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 902e668e3..fd2bbbd99 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h | |||
| @@ -36,6 +36,13 @@ | |||
| 36 | #include "common/common_funcs.h" | 36 | #include "common/common_funcs.h" |
| 37 | #include "common/swap.h" | 37 | #include "common/swap.h" |
| 38 | 38 | ||
| 39 | // Inlining | ||
| 40 | #ifdef _WIN32 | ||
| 41 | #define FORCE_INLINE __forceinline | ||
| 42 | #else | ||
| 43 | #define FORCE_INLINE inline __attribute__((always_inline)) | ||
| 44 | #endif | ||
| 45 | |||
| 39 | /* | 46 | /* |
| 40 | * Abstract bitfield class | 47 | * Abstract bitfield class |
| 41 | * | 48 | * |
| @@ -168,11 +175,11 @@ public: | |||
| 168 | constexpr BitField(BitField&&) noexcept = default; | 175 | constexpr BitField(BitField&&) noexcept = default; |
| 169 | constexpr BitField& operator=(BitField&&) noexcept = default; | 176 | constexpr BitField& operator=(BitField&&) noexcept = default; |
| 170 | 177 | ||
| 171 | constexpr FORCE_INLINE operator T() const { | 178 | constexpr operator T() const { |
| 172 | return Value(); | 179 | return Value(); |
| 173 | } | 180 | } |
| 174 | 181 | ||
| 175 | constexpr FORCE_INLINE void Assign(const T& value) { | 182 | constexpr void Assign(const T& value) { |
| 176 | storage = (static_cast<StorageType>(storage) & ~mask) | FormatValue(value); | 183 | storage = (static_cast<StorageType>(storage) & ~mask) | FormatValue(value); |
| 177 | } | 184 | } |
| 178 | 185 | ||