Add support for MSVC

This commit is contained in:
Jonathan Marler
2017-09-10 14:05:18 -06:00
committed by Jonathan Marler
parent 373785ae8d
commit 7c81cd30de
17 changed files with 238 additions and 60 deletions

View File

@@ -234,7 +234,7 @@ struct Tokenize {
BigInt significand;
};
__attribute__ ((format (printf, 2, 3)))
ATTRIBUTE_FORMAT(printf, 2, 3)
static void tokenize_error(Tokenize *t, const char *format, ...) {
t->state = TokenizeStateError;
@@ -331,7 +331,7 @@ static void end_float_token(Tokenize *t) {
if (t->radix == 10) {
zig_panic("TODO: decimal floats");
} else {
int significand_magnitude_in_bin = __builtin_clzll(1) - __builtin_clzll(significand);
int significand_magnitude_in_bin = clzll(1) - clzll(significand);
t->exponent_in_bin_or_dec += significand_magnitude_in_bin;
if (!(-1022 <= t->exponent_in_bin_or_dec && t->exponent_in_bin_or_dec <= 1023)) {
t->cur_tok->data.float_lit.overflow = true;