From 3ad496e4a6e1424e1a122ee280cdf4e0f2f24683 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 20 Apr 2021 04:52:49 -0700 Subject: configure: remove LIT_ALIGN. LIT_ALIGN was introduced before there was SIZEOF_WCHAR_T. The latter was introduced on suspicion that they might not be the same. Since LIT_ALIGN is tied to SIZEOF_WCHAR_T again there is no need for it to exist. * configure (lit_align): Variable removed. Documentation of lit-align argument removed. Alignment of wide literals test removed. Not generating LIT_ALIGN in config.h any more. * lib.h (LIT_ALIGN): Occurrences replaced with SIZEOF_WCHAR_T. --- configure | 37 ------------------------------------- lib.h | 6 +++--- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/configure b/configure index 6b104cf1..75872b7d 100755 --- a/configure +++ b/configure @@ -182,7 +182,6 @@ platform_ldflags= platform_ldlibs= txr_dbg_opts=--gc-debug valgrind= -lit_align= extra_debugging= debug_support=y gen_gc=y @@ -411,15 +410,6 @@ intptr [$intptr] value can be converted to it. If this is blank, the configure script will try to auto detect it. -lit-align [$lit_align] - - Specifies alignment for wide string literals. This is guessed - from the size of the wchar_t type. If your wchar_t type is two byte wide, but - wide literals are aligned to four bytes, then you should specify this. This - will eliminate some kludges in the program. There is no easy way to check - for this withut generating and running a C program, which is unfriendly - for cross-compiling! - inline [$inline] Specifies the syntax for defining an inline function, in such @@ -1482,33 +1472,6 @@ then printf "typedef superulong_t double_uintptr_t;\n" >> config.h fi -# -# Alignment of wchar_t -# -# What we really want to know is the alignment of wide string literals -# like L"wide literal". -# -# We make pessimistic assumption that the size of the wchar_t type is this -# alignment. -# -# There is no easy way to get the information without running a compiled -# program. -# - -printf "Conservatively guessing the alignment of wide literals ... " - -if [ -z "$lit_align" ] ; then - if [ $SIZEOF_WCHAR_T -eq 0 ] ; then - printf "failed\n" - exit 1 - fi - - lit_align=$SIZEOF_WCHAR_T -fi - -printf "%d\n" "$lit_align" -printf "#define LIT_ALIGN %d\n" "$lit_align" >> config.h - # # Endianness. # diff --git a/lib.h b/lib.h index 0eaa77d7..d95642b1 100644 --- a/lib.h +++ b/lib.h @@ -425,7 +425,7 @@ INLINE type_t type(val obj) typedef struct wli wchli_t; -#if LIT_ALIGN < 4 +#if SIZEOF_WCHAR_T < 4 #define wli_noex(lit) (coerce(const wchli_t *,\ convert(const wchar_t *,\ L"\0" L ## lit L"\0" + 1))) @@ -452,7 +452,7 @@ INLINE val static_str(const wchli_t *str) INLINE wchar_t *litptr(val obj) { -#if LIT_ALIGN < 4 +#if SIZEOF_WCHAR_T < 4 wchar_t *ret = coerce(wchar_t *, (coerce(cnum, obj) & ~TAG_MASK)); return (*ret == 0) ? ret + 1 : ret; #else @@ -479,7 +479,7 @@ INLINE cnum c_n(val num) { return coerce(cnum, num) >> TAG_SHIFT; } -#if LIT_ALIGN < 4 +#if SIZEOF_WCHAR_T < 4 #define lit_noex(strlit) coerce(obj_t *,\ coerce(cnum, L"\0" L ## strlit L"\0" + 1) | \ TAG_LIT) -- cgit v1.2.3