summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2009-11-16 22:05:28 -0800
committerKaz Kylheku <kaz@kylheku.com>2009-11-16 22:05:28 -0800
commit3a6c04927b4136a195b0bc259f50caf8249dfced (patch)
treed8972160fe49f6ccb60ea868a0af2fdd4d60845e /lib.h
parentfb2f0af8bd14283524e5842b43461ea3fc7701ca (diff)
downloadtxr-3a6c04927b4136a195b0bc259f50caf8249dfced.tar.gz
txr-3a6c04927b4136a195b0bc259f50caf8249dfced.tar.bz2
txr-3a6c04927b4136a195b0bc259f50caf8249dfced.zip
Big round of changes to switch the code base to use the stream
abstraction instead of directly using C standard I/O, to eliminate most uses of C formatted I/O, and fix numerous bugs, such variadic argument lists which lack a terminating ``nao'' sentinel. Bug 28033 is addressed by this patch, since streams no longer provide printf-compatible formatting. The native formatter is extended with some additional capabilities to take over. The work on literal objects is expanded and they are now used throughout the code base. Fixed bad realloc in string output stream: reallocating by number of wide chars rather than bytes.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib.h b/lib.h
index 4db6ebf8..47f33e1a 100644
--- a/lib.h
+++ b/lib.h
@@ -51,7 +51,10 @@ typedef enum functype
#define is_chr(obj) (tag(obj) == TAG_CHR)
#define is_lit(obj) (tag(obj) == TAG_LIT)
#define type(obj) (tag(obj) ? ((type_t) tag(obj)) : (obj)->t.type)
-#define lit(strlit) ((obj_t *) ((long) (L ## strlit) | TAG_LIT))
+#define lit_noex(strlit) ((obj_t *) ((long) (L ## strlit) | TAG_LIT))
+#define lit(strlit) lit_noex(strlit)
+#define auto_str(str) ((obj_t *) ((long) (str) | TAG_LIT))
+#define static_str(str) ((obj_t *) ((long) (str) | TAG_LIT))
#define litptr(obj) ((wchar_t *) ((long) obj & ~TAG_MASK))
typedef union obj obj_t;