Skip to content

Commit 7eb70c6

Browse files
committed
Manually write out a bswap so that code works on all compilers
1 parent 5ad773c commit 7eb70c6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

thecl/ecsscan.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ ins_[0-9]+ {
168168
return INTEGER;
169169
}
170170
#[0-9a-fA-F]{8} {
171-
uint32_t color_integer = strtoul(yytext+1, NULL, 16);
172-
yylval.integer = _byteswap_ulong(color_integer);
171+
uint32_t color_int = strtoul(yytext+1, NULL, 16);
172+
yylval.integer = (color_int & 0xFF000000) >> 24 | (color_int & 0xFF0000) >> 8 | (color_int & 0xFF00) << 8 | (color_int & 0xFF) << 24;
173173
return INTEGER;
174174
}
175175
"false" {

0 commit comments

Comments
 (0)