diff options
author | David 'Digit' Turner <digit@android.com> | 2010-12-22 17:38:44 +0100 |
---|---|---|
committer | David 'Digit' Turner <digit@android.com> | 2011-01-02 22:02:30 +0100 |
commit | 1cea2fb59edca80938ae42c2b8c2af0aba8016b4 (patch) | |
tree | 305fa80deb4fcfd70a0ee547de63eb6ce09ca5fe /json-lexer.c | |
parent | 3641106bb6a97e674c767e3805a8b3efa628dc47 (diff) | |
download | external_qemu-1cea2fb59edca80938ae42c2b8c2af0aba8016b4.zip external_qemu-1cea2fb59edca80938ae42c2b8c2af0aba8016b4.tar.gz external_qemu-1cea2fb59edca80938ae42c2b8c2af0aba8016b4.tar.bz2 |
upstream: minor json-lexer.c integration.
Change-Id: Ia949694386f79c763ac4f001924a9e3cca754933
Note: Keep our fix for mingw builds.
Diffstat (limited to 'json-lexer.c')
-rw-r--r-- | json-lexer.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/json-lexer.c b/json-lexer.c index 072ae56..534fcf7 100644 --- a/json-lexer.c +++ b/json-lexer.c @@ -27,8 +27,12 @@ * */ +/* Building with mingw results in an error because ERROR is defined as a + * macro in this environment. Undefined it */ +#undef ERROR + enum json_lexer_state { - JSON_ERROR = 0, + ERROR = 0, IN_DQ_UCODE3, IN_DQ_UCODE2, IN_DQ_UCODE1, @@ -150,7 +154,7 @@ static const uint8_t json_lexer[][256] = { /* Zero */ [IN_ZERO] = { TERMINAL(JSON_INTEGER), - ['0' ... '9'] = JSON_ERROR, + ['0' ... '9'] = ERROR, ['.'] = IN_MANTISSA, }, @@ -302,7 +306,7 @@ static int json_lexer_feed_char(JSONLexer *lexer, char ch) lexer->token = qstring_new(); new_state = IN_START; break; - case JSON_ERROR: + case ERROR: return -EINVAL; default: break; |