Skip to content

Commit b5c6850

Browse files
committed
use MSVC attribute
1 parent c1b6ff4 commit b5c6850

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

autobahn/nvx/_utf8validator.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ void nvx_utf8vld_free (void* utf8vld) {
122122

123123
// unrolled DFA from http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
124124
//
125+
// Use proper alignment attribute for each compiler
126+
#if defined(_MSC_VER)
127+
static __declspec(align(64)) const uint8_t UTF8VALIDATOR_DFA[] =
128+
#else
125129
static const uint8_t UTF8VALIDATOR_DFA[] __attribute__((aligned(64))) =
130+
#endif
126131
{
127132
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 00..1f
128133
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 20..3f

0 commit comments

Comments
 (0)