diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | lib.h | 10 |
2 files changed, 12 insertions, 9 deletions
@@ -1,3 +1,14 @@ +2011-10-12 Kaz Kylheku <kaz@kylheku.com> + + Bug #34538 + + * lib.h (wli): This macro now does the pointer displacement by 1. + (auto_str, static_str): #if/#else/#endif gone. These functions just + add the type tag. The + 1 logic was incorrect; it should have + been + sizeof(wchar_t). But even that was not right because other + code expects a wchli_t * to point to the first character, + such as the string_out_put_char function. + 2011-10-10 Kaz Kylheku <kaz@kylheku.com> Improved support for broken unicode. @@ -191,7 +191,7 @@ INLINE type_t type(val obj) typedef struct wli wchli_t; #if LIT_ALIGN < 4 -#define wli(lit) ((const wchli_t *) L"\0" L ## lit L"\0") +#define wli(lit) ((const wchli_t *) (L"\0" L ## lit L"\0" + 1)) #define wini(ini) L"\0" L ## ini L"\0" #define wref(arr) ((arr) + 1) #else @@ -202,20 +202,12 @@ typedef struct wli wchli_t; INLINE val auto_str(const wchli_t *str) { -#if LIT_ALIGN < 4 - return (val) (((cnum) str + 1) | TAG_LIT); -#else return (val) (((cnum) str) | TAG_LIT); -#endif } INLINE val static_str(const wchli_t *str) { -#if LIT_ALIGN < 4 - return (val) (((cnum) str + 1) | TAG_LIT); -#else return (val) (((cnum) str) | TAG_LIT); -#endif } INLINE wchar_t *litptr(val obj) |