diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2012-05-16 15:18:44 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2012-05-16 15:18:44 +0000 |
| commit | f4c17cb7aa1517739c5aea5155e17fc9d1b2f05e (patch) | |
| tree | daf935713c70a871e9131d2d92eb97e7ac7b6aee /src/runtime/c/gu | |
| parent | 6f328c9040b394054eff399f26d3b7aea6567206 (diff) | |
another attempt to port the robust parser to MacOS
Diffstat (limited to 'src/runtime/c/gu')
| -rw-r--r-- | src/runtime/c/gu/mem.h | 6 | ||||
| -rw-r--r-- | src/runtime/c/gu/seq.c | 1 | ||||
| -rw-r--r-- | src/runtime/c/gu/string.c | 2 | ||||
| -rw-r--r-- | src/runtime/c/gu/sysdeps.h | 3 | ||||
| -rw-r--r-- | src/runtime/c/gu/ucs.c | 6 | ||||
| -rw-r--r-- | src/runtime/c/gu/ucs.h | 2 | ||||
| -rw-r--r-- | src/runtime/c/gu/utf8.c | 4 | ||||
| -rw-r--r-- | src/runtime/c/gu/utf8.h | 4 |
8 files changed, 14 insertions, 14 deletions
diff --git a/src/runtime/c/gu/mem.h b/src/runtime/c/gu/mem.h index 4369f4036..e389bcc0c 100644 --- a/src/runtime/c/gu/mem.h +++ b/src/runtime/c/gu/mem.h @@ -171,7 +171,7 @@ gu_malloc_init(GuPool* pool, size_t size, const void* init) -#ifdef GU_HAVE_STATEMENT_EXPRESSIONS +#ifdef HAVE_STATEMENT_EXPRESSIONS #define gu_new_i(pool, type, ...) \ ({ \ type *gu_new_p_ = gu_new(type, pool); \ @@ -179,12 +179,12 @@ gu_malloc_init(GuPool* pool, size_t size, const void* init) sizeof(type)); \ gu_new_p_; \ }) -#else // GU_HAVE_STATEMENT_EXPRESSIONS +#else // HAVE_STATEMENT_EXPRESSIONS #define gu_new_i(pool, type, ...) \ ((type*)gu_malloc_init_aligned((pool), sizeof(type), \ gu_alignof(type), \ &(type){ __VA_ARGS__ })) -#endif // GU_HAVE_STATEMENT_EXPRESSIONS +#endif // HAVE_STATEMENT_EXPRESSIONS /** @def gu_new_i(pool, type, ...) * diff --git a/src/runtime/c/gu/seq.c b/src/runtime/c/gu/seq.c index 761d8d945..fda1be99c 100644 --- a/src/runtime/c/gu/seq.c +++ b/src/runtime/c/gu/seq.c @@ -304,6 +304,7 @@ gu_buf_out(GuBuf* buf, GuPool* pool) bout->stream.output = gu_buf_out_output; bout->stream.begin_buf = gu_buf_outbuf_begin; bout->stream.end_buf = gu_buf_outbuf_end; + bout->stream.flush = NULL; bout->buf = buf; return gu_new_out(&bout->stream, pool); } diff --git a/src/runtime/c/gu/string.c b/src/runtime/c/gu/string.c index 0af0ce7be..d7e29fafe 100644 --- a/src/runtime/c/gu/string.c +++ b/src/runtime/c/gu/string.c @@ -195,7 +195,7 @@ gu_format_string(GuPool* pool, const char* fmt, ...) GuString gu_str_string(const char* str, GuPool* pool) { -#ifdef GU_CHAR_ASCII +#ifdef CHAR_ASCII return gu_utf8_string((const uint8_t*) str, strlen(str), pool); #else GuPool* tmp_pool = gu_local_pool(); diff --git a/src/runtime/c/gu/sysdeps.h b/src/runtime/c/gu/sysdeps.h index 114e1c40d..c13945b5d 100644 --- a/src/runtime/c/gu/sysdeps.h +++ b/src/runtime/c/gu/sysdeps.h @@ -1,7 +1,7 @@ #ifndef GU_SYSDEPS_H_ #define GU_SYSDEPS_H_ -#include <guconfig.h> +#include <config.h> #if defined(__GNUC__) && !defined(__STRICT_ANSI__) # define GU_GNUC @@ -9,7 +9,6 @@ #ifdef GU_GNUC # define GU_ALIGNOF __alignof -# define GU_HAVE_STATEMENT_EXPRESSIONS # define GU_GNUC_ATTR(x) __attribute__(( x )) # if defined(__OPTIMIZE_SIZE__) # define GU_OPTIMIZE_SIZE diff --git a/src/runtime/c/gu/ucs.c b/src/runtime/c/gu/ucs.c index 34649f36a..dc210b312 100644 --- a/src/runtime/c/gu/ucs.c +++ b/src/runtime/c/gu/ucs.c @@ -1,11 +1,11 @@ #include <gu/ucs.h> #include <gu/assert.h> -#include <guconfig.h> +#include <config.h> GU_DEFINE_TYPE(GuUCSExn, abstract, _); -#ifdef GU_CHAR_ASCII +#ifdef CHAR_ASCII bool gu_char_is_valid(char c) @@ -36,7 +36,7 @@ gu_ucs_char(GuUCS uc, GuExn* err) return 0; } -#else // defined(GU_CHAR_ASCII) +#else // defined(CHAR_ASCII) static const char gu_ucs_ascii[128] = "\0\0\0\0\0\0\0\a\b\t\n\v\f\r\0\0" diff --git a/src/runtime/c/gu/ucs.h b/src/runtime/c/gu/ucs.h index f1662a602..0c9e7cce0 100644 --- a/src/runtime/c/gu/ucs.h +++ b/src/runtime/c/gu/ucs.h @@ -29,7 +29,7 @@ inline GuUCS gu_char_ucs(char c) { gu_require(gu_char_is_valid(c)); -#ifdef GU_CHAR_ASCII +#ifdef CHAR_ASCII GuUCS u = (GuUCS) c; #else extern const uint8_t gu_ucs_ascii_reverse_[CHAR_MAX]; diff --git a/src/runtime/c/gu/utf8.c b/src/runtime/c/gu/utf8.c index a416c2dac..b1d5996c2 100644 --- a/src/runtime/c/gu/utf8.c +++ b/src/runtime/c/gu/utf8.c @@ -1,6 +1,6 @@ #include <gu/assert.h> #include <gu/utf8.h> -#include <guconfig.h> +#include <config.h> GuUCS gu_utf8_decode(const uint8_t** src_inout) @@ -180,7 +180,7 @@ gu_utf32_out_utf8(const GuUCS* src, size_t len, GuOut* out, GuExn* err) } -#ifndef GU_CHAR_ASCII +#ifndef CHAR_ASCII void gu_str_out_utf8_(const char* str, GuOut* out, GuExn* err) { diff --git a/src/runtime/c/gu/utf8.h b/src/runtime/c/gu/utf8.h index 053d8664e..c4112b5a5 100644 --- a/src/runtime/c/gu/utf8.h +++ b/src/runtime/c/gu/utf8.h @@ -21,7 +21,7 @@ gu_in_utf8(GuIn* in, GuExn* err) inline char gu_in_utf8_char(GuIn* in, GuExn* err) { -#ifdef GU_CHAR_ASCII +#ifdef CHAR_ASCII int i = gu_in_peek_u8(in); if (i >= 0 && i < 0x80) { gu_in_consume(in, 1); @@ -55,7 +55,7 @@ gu_utf8_decode(const uint8_t** utf8); inline void gu_str_out_utf8(const char* str, GuOut* out, GuExn* err) { -#ifdef GU_CHAR_ASCII +#ifdef CHAR_ASCII gu_out_bytes(out, (const uint8_t*) str, strlen(str), err); #else extern void |
