Skip to content

Commit aec1819

Browse files
committed
Fix MSVC compat
1 parent 9eaa22b commit aec1819

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 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
*/

0 commit comments

Comments
 (0)