summaryrefslogtreecommitdiffstats
path: root/stream.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-10-09 22:50:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2011-10-09 22:50:12 -0700
commit41b7cf934f8af2a9fb622790bd28e2e8742ba380 (patch)
treeb740872ac2ec8638bb0b2e296c8697ac021dbdda /stream.c
parent4c7f6f212eca77c2aae3d4bbc9b6be7f683cf260 (diff)
downloadtxr-41b7cf934f8af2a9fb622790bd28e2e8742ba380.tar.gz
txr-41b7cf934f8af2a9fb622790bd28e2e8742ba380.tar.bz2
txr-41b7cf934f8af2a9fb622790bd28e2e8742ba380.zip
One more swing at this with the axe.
* lib.h (wini, wref): New macros. * stream.c (string_out_put_char): Rewritten with macros to eliminate preprocessor #if test.
Diffstat (limited to 'stream.c')
-rw-r--r--stream.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/stream.c b/stream.c
index 84d417a7..d9885971 100644
--- a/stream.c
+++ b/stream.c
@@ -415,18 +415,9 @@ static val string_out_put_string(val stream, val str)
static val string_out_put_char(val stream, val ch)
{
-#if LIT_ALIGN < 4
- wchar_t mini[3];
- mini[0] = 0;
- mini[1] = c_chr(ch);
- mini[2] = 0;
- return string_out_put_string(stream, auto_str((const wchli_t *) (mini + 1)));
-#else
- wchar_t mini[2];
- mini[0] = c_chr(ch);
- mini[1] = 0;
- return string_out_put_string(stream, auto_str((const wchli_t *) mini));
-#endif
+ wchar_t onech[] = wini(" ");
+ wref(onech)[0] = c_chr(ch);
+ return string_out_put_string(stream, auto_str((const wchli_t *) wref(onech)));
}
static struct strm_ops string_out_ops = {