Skip to content

Commit b202af7

Browse files
authored
NONE - Fix MSVC compat (#17)
2 parents 9eaa22b + 6634d69 commit b202af7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/vtfparser/file-format-objects/header.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
#include <cstdint>
66
#include "enums.hpp"
77

8+
#ifdef _MSC_VER
9+
#define align(x) alignas(x)
10+
#else
11+
#define align(x) __attribute__((aligned(x)))
12+
#endif
13+
814
namespace VtfParser {
915
#pragma pack(push, 1)
1016

@@ -29,7 +35,7 @@ namespace VtfParser {
2935
/**
3036
* Aligned full header (only for alignment reasons, do not use outside of Header declaration).
3137
*/
32-
struct __attribute__((aligned(16))) HeaderFullAligned : public HeaderBase {
38+
struct align(16) HeaderFullAligned : public HeaderBase {
3339
/**
3440
* Width of the largest mipmap in pixels. Must be a power of 2.
3541
*/
@@ -131,3 +137,5 @@ namespace VtfParser {
131137

132138
#pragma pack(pop)
133139
}
140+
141+
#undef align

0 commit comments

Comments
 (0)