added --enable-unicode to configure.ac
cleaned up unnecessary code
This commit is contained in:
parent
a1ce05a5fb
commit
cfdc22ee60
@ -165,8 +165,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \
|
||||
$(top_srcdir)/ac/compile $(top_srcdir)/ac/config.guess \
|
||||
$(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \
|
||||
$(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing ac/ar-lib \
|
||||
ac/compile ac/config.guess ac/config.sub ac/install-sh \
|
||||
ac/ltmain.sh ac/missing
|
||||
ac/compile ac/config.guess ac/config.sub ac/depcomp \
|
||||
ac/install-sh ac/ltmain.sh ac/missing
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
@ -245,6 +245,8 @@ HAVE_CXX = @HAVE_CXX@
|
||||
HCL_PROJECT_AUTHOR = @HCL_PROJECT_AUTHOR@
|
||||
HCL_PROJECT_URL = @HCL_PROJECT_URL@
|
||||
HCL_SIZEOF_CHAR = @HCL_SIZEOF_CHAR@
|
||||
HCL_SIZEOF_CHAR16_T = @HCL_SIZEOF_CHAR16_T@
|
||||
HCL_SIZEOF_CHAR32_T = @HCL_SIZEOF_CHAR32_T@
|
||||
HCL_SIZEOF_DOUBLE = @HCL_SIZEOF_DOUBLE@
|
||||
HCL_SIZEOF_FLOAT = @HCL_SIZEOF_FLOAT@
|
||||
HCL_SIZEOF_INT = @HCL_SIZEOF_INT@
|
||||
|
131
configure
vendored
131
configure
vendored
@ -648,6 +648,8 @@ HCL_SIZEOF_SHORT
|
||||
HCL_SIZEOF_INT
|
||||
HCL_SIZEOF_LONG
|
||||
HCL_SIZEOF_LONG_LONG
|
||||
HCL_SIZEOF_CHAR32_T
|
||||
HCL_SIZEOF_CHAR16_T
|
||||
HCL_SIZEOF_WCHAR_T
|
||||
ENABLE_STATIC_MODULE_FALSE
|
||||
ENABLE_STATIC_MODULE_TRUE
|
||||
@ -801,6 +803,8 @@ with_gnu_ld
|
||||
with_sysroot
|
||||
enable_libtool_lock
|
||||
enable_debug
|
||||
enable_override_uch
|
||||
enable_unicode
|
||||
enable_cxx
|
||||
enable_dynamic_module
|
||||
enable_static_module
|
||||
@ -1449,6 +1453,10 @@ Optional Features:
|
||||
optimize for fast installation [default=yes]
|
||||
--disable-libtool-lock avoid locking (might break parallel builds)
|
||||
--enable-debug build the library in the debug mode (default. no)
|
||||
--enable-override-uch Use the specified unicode character type (default.
|
||||
no)
|
||||
--enable-unicode Use the unicode character type as the default
|
||||
character type (default. yes)
|
||||
--enable-cxx build the library for C++ if a C++ compiler is
|
||||
available (default. yes)
|
||||
--enable-dynamic-module enable dynamic module capability(default. yes)
|
||||
@ -18604,6 +18612,72 @@ cat >>confdefs.h <<_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
# This bug is HP SR number 8606223364.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char16_t" >&5
|
||||
$as_echo_n "checking size of char16_t... " >&6; }
|
||||
if ${ac_cv_sizeof_char16_t+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char16_t))" "ac_cv_sizeof_char16_t" "$ac_includes_default"; then :
|
||||
|
||||
else
|
||||
if test "$ac_cv_type_char16_t" = yes; then
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error 77 "cannot compute sizeof (char16_t)
|
||||
See \`config.log' for more details" "$LINENO" 5; }
|
||||
else
|
||||
ac_cv_sizeof_char16_t=0
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char16_t" >&5
|
||||
$as_echo "$ac_cv_sizeof_char16_t" >&6; }
|
||||
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define SIZEOF_CHAR16_T $ac_cv_sizeof_char16_t
|
||||
_ACEOF
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
# This bug is HP SR number 8606223364.
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char32_t" >&5
|
||||
$as_echo_n "checking size of char32_t... " >&6; }
|
||||
if ${ac_cv_sizeof_char32_t+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char32_t))" "ac_cv_sizeof_char32_t" "$ac_includes_default"; then :
|
||||
|
||||
else
|
||||
if test "$ac_cv_type_char32_t" = yes; then
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error 77 "cannot compute sizeof (char32_t)
|
||||
See \`config.log' for more details" "$LINENO" 5; }
|
||||
else
|
||||
ac_cv_sizeof_char32_t=0
|
||||
fi
|
||||
fi
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char32_t" >&5
|
||||
$as_echo "$ac_cv_sizeof_char32_t" >&6; }
|
||||
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define SIZEOF_CHAR32_T $ac_cv_sizeof_char32_t
|
||||
_ACEOF
|
||||
|
||||
|
||||
# The cast to long int works around a bug in the HP C Compiler
|
||||
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
|
||||
# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
|
||||
@ -19337,6 +19411,59 @@ else
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-override-uch was given.
|
||||
if test "${enable_override_uch+set}" = set; then :
|
||||
enableval=$enable_override_uch; enable_override_uch=$enableval
|
||||
else
|
||||
enable_override_uch=no
|
||||
|
||||
fi
|
||||
|
||||
if test "${enable_override_uch}" = "wchar_t"
|
||||
then
|
||||
test "${ac_cv_sizeof_wchar_t}" = "0" && enable_override_uch=no
|
||||
test "${ac_cv_sizeof_wchar_t}" = "1" && enable_override_uch=no
|
||||
elif test "${enable_override_uch}" = "char16_t"
|
||||
then
|
||||
test "${ac_cv_sizeof_char16_t}" = "0" && enable_override_uch=no
|
||||
elif test "${enable_override_uch}" = "char32_t"
|
||||
then
|
||||
test "${ac_cv_sizeof_char32_t}" = "0" && enable_override_uch=no
|
||||
fi
|
||||
|
||||
if test "${enable_override_uch}" = "wchar_t"
|
||||
then
|
||||
|
||||
$as_echo "#define HCL_OVERRIDE_UCH_TYPE wchar_t" >>confdefs.h
|
||||
|
||||
elif test "${enable_override_uch}" = "char16_t"
|
||||
then
|
||||
|
||||
$as_echo "#define HCL_OVERRIDE_UCH_TYPE char16_t" >>confdefs.h
|
||||
|
||||
elif test "${enable_override_uch}" = "char32_t"
|
||||
then
|
||||
|
||||
$as_echo "#define HCL_OVERRIDE_UCH_TYPE char32_t" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Check whether --enable-unicode was given.
|
||||
if test "${enable_unicode+set}" = set; then :
|
||||
enableval=$enable_unicode; enable_unicode=$enableval
|
||||
else
|
||||
enable_unicode=yes
|
||||
|
||||
fi
|
||||
|
||||
if test "${enable_unicode}" = "yes"
|
||||
then
|
||||
|
||||
$as_echo "#define HCL_ENABLE_UNICODE /**/" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Check whether --enable-cxx was given.
|
||||
if test "${enable_cxx+set}" = set; then :
|
||||
enableval=$enable_cxx; enable_cxx_is=$enableval
|
||||
@ -19411,6 +19538,10 @@ fi
|
||||
|
||||
HCL_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
|
||||
|
||||
HCL_SIZEOF_CHAR16_T=$ac_cv_sizeof_char16_t
|
||||
|
||||
HCL_SIZEOF_CHAR32_T=$ac_cv_sizeof_char32_t
|
||||
|
||||
HCL_SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
|
||||
|
||||
HCL_SIZEOF_LONG=$ac_cv_sizeof_long
|
||||
|
43
configure.ac
43
configure.ac
@ -234,6 +234,8 @@ AC_CHECK_SIZEOF(long double,,[[]])
|
||||
AC_CHECK_SIZEOF(__float128,,[[]])
|
||||
|
||||
AC_CHECK_SIZEOF(wchar_t)
|
||||
AC_CHECK_SIZEOF(char16_t)
|
||||
AC_CHECK_SIZEOF(char32_t)
|
||||
AC_CHECK_SIZEOF(off_t)
|
||||
AC_CHECK_SIZEOF(off64_t)
|
||||
|
||||
@ -404,6 +406,45 @@ else
|
||||
AC_SUBST(BUILD_MODE, "release")
|
||||
fi
|
||||
|
||||
|
||||
AC_ARG_ENABLE([override-uch],
|
||||
[AS_HELP_STRING([--enable-override-uch],[Use the specified unicode character type (default. no)])],
|
||||
enable_override_uch=$enableval,
|
||||
enable_override_uch=no
|
||||
)
|
||||
if test "${enable_override_uch}" = "wchar_t"
|
||||
then
|
||||
test "${ac_cv_sizeof_wchar_t}" = "0" && enable_override_uch=no
|
||||
test "${ac_cv_sizeof_wchar_t}" = "1" && enable_override_uch=no
|
||||
elif test "${enable_override_uch}" = "char16_t"
|
||||
then
|
||||
test "${ac_cv_sizeof_char16_t}" = "0" && enable_override_uch=no
|
||||
elif test "${enable_override_uch}" = "char32_t"
|
||||
then
|
||||
test "${ac_cv_sizeof_char32_t}" = "0" && enable_override_uch=no
|
||||
fi
|
||||
|
||||
if test "${enable_override_uch}" = "wchar_t"
|
||||
then
|
||||
AC_DEFINE([HCL_OVERRIDE_UCH_TYPE],[wchar_t],[unicode character type])
|
||||
elif test "${enable_override_uch}" = "char16_t"
|
||||
then
|
||||
AC_DEFINE([HCL_OVERRIDE_UCH_TYPE],[char16_t],[unicode character type])
|
||||
elif test "${enable_override_uch}" = "char32_t"
|
||||
then
|
||||
AC_DEFINE([HCL_OVERRIDE_UCH_TYPE],[char32_t],[unicode character type])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([unicode],
|
||||
[AS_HELP_STRING([--enable-unicode],[Use the unicode character type as the default character type (default. yes)])],
|
||||
enable_unicode=$enableval,
|
||||
enable_unicode=yes
|
||||
)
|
||||
if test "${enable_unicode}" = "yes"
|
||||
then
|
||||
AC_DEFINE([HCL_ENABLE_UNICODE],[],[Use the unicode character type as the default character type])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE([cxx],
|
||||
[AS_HELP_STRING([--enable-cxx],[build the library for C++ if a C++ compiler is available (default. yes)])],
|
||||
enable_cxx_is=$enableval,
|
||||
@ -447,6 +488,8 @@ fi
|
||||
AM_CONDITIONAL(ENABLE_STATIC_MODULE, test "${enable_static_module_is}" = "yes")
|
||||
|
||||
AC_SUBST(HCL_SIZEOF_WCHAR_T, $ac_cv_sizeof_wchar_t)
|
||||
AC_SUBST(HCL_SIZEOF_CHAR16_T, $ac_cv_sizeof_char16_t)
|
||||
AC_SUBST(HCL_SIZEOF_CHAR32_T, $ac_cv_sizeof_char32_t)
|
||||
AC_SUBST(HCL_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
|
||||
AC_SUBST(HCL_SIZEOF_LONG, $ac_cv_sizeof_long)
|
||||
AC_SUBST(HCL_SIZEOF_INT, $ac_cv_sizeof_int)
|
||||
|
@ -267,6 +267,8 @@ HAVE_CXX = @HAVE_CXX@
|
||||
HCL_PROJECT_AUTHOR = @HCL_PROJECT_AUTHOR@
|
||||
HCL_PROJECT_URL = @HCL_PROJECT_URL@
|
||||
HCL_SIZEOF_CHAR = @HCL_SIZEOF_CHAR@
|
||||
HCL_SIZEOF_CHAR16_T = @HCL_SIZEOF_CHAR16_T@
|
||||
HCL_SIZEOF_CHAR32_T = @HCL_SIZEOF_CHAR32_T@
|
||||
HCL_SIZEOF_DOUBLE = @HCL_SIZEOF_DOUBLE@
|
||||
HCL_SIZEOF_FLOAT = @HCL_SIZEOF_FLOAT@
|
||||
HCL_SIZEOF_INT = @HCL_SIZEOF_INT@
|
||||
|
@ -2099,11 +2099,11 @@ static int execute (hcl_t* hcl)
|
||||
/* it emulates thisContext blockCopy: nargs ofTmprCount: ntmprs */
|
||||
HCL_ASSERT (hcl, hcl->sp >= 2);
|
||||
|
||||
HCL_ASSERT (hcl, HCL_CLASSOF(hcl, HCL_STACK_GETTOP(hcl)) == hcl->_small_integer);
|
||||
HCL_ASSERT (hcl, HCL_OOP_IS_SMOOI(HCL_STACK_GETTOP(hcl)));
|
||||
ntmprs = HCL_OOP_TO_SMOOI(HCL_STACK_GETTOP(hcl));
|
||||
HCL_STACK_POP (hcl);
|
||||
|
||||
HCL_ASSERT (hcl, HCL_CLASSOF(hcl, HCL_STACK_GETTOP(hcl)) == hcl->_small_integer);
|
||||
HCL_ASSERT (hcl, HCL_OOP_IS_SMOOI(HCL_STACK_GETTOP(hcl)));
|
||||
nargs = HCL_OOP_TO_SMOOI(HCL_STACK_GETTOP(hcl));
|
||||
HCL_STACK_POP (hcl);
|
||||
|
||||
|
1
lib/gc.c
1
lib/gc.c
@ -321,7 +321,6 @@ void hcl_gc (hcl_t* hcl)
|
||||
*(hcl_oop_t*)((hcl_uint8_t*)hcl + syminfo[i].offset) = tmp;
|
||||
}
|
||||
|
||||
hcl->_class = hcl_moveoop (hcl, hcl->_class);
|
||||
hcl->_character = hcl_moveoop (hcl, hcl->_character);
|
||||
hcl->_small_integer = hcl_moveoop (hcl, hcl->_small_integer);
|
||||
hcl->_large_positive_integer = hcl_moveoop (hcl, hcl->_large_positive_integer);
|
||||
|
@ -222,6 +222,9 @@
|
||||
/* link modules statically into the main library */
|
||||
#undef HCL_ENABLE_STATIC_MODULE
|
||||
|
||||
/* Use the unicode character type as the default character type */
|
||||
#undef HCL_ENABLE_UNICODE
|
||||
|
||||
/* Big Endian */
|
||||
#undef HCL_ENDIAN_BIG
|
||||
|
||||
@ -234,6 +237,9 @@
|
||||
/* MB_LEN_MAX */
|
||||
#undef HCL_MBLEN_MAX
|
||||
|
||||
/* unicode character type */
|
||||
#undef HCL_OVERRIDE_UCH_TYPE
|
||||
|
||||
/* Author */
|
||||
#undef HCL_PACKAGE_AUTHOR
|
||||
|
||||
@ -348,6 +354,12 @@
|
||||
/* The size of `char', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR
|
||||
|
||||
/* The size of `char16_t', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR16_T
|
||||
|
||||
/* The size of `char32_t', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR32_T
|
||||
|
||||
/* The size of `double', as computed by sizeof. */
|
||||
#undef SIZEOF_DOUBLE
|
||||
|
||||
|
@ -318,20 +318,18 @@ struct hcl_bcs_t
|
||||
};
|
||||
typedef struct hcl_bcs_t hcl_bcs_t;
|
||||
|
||||
|
||||
#if 0
|
||||
typedef hcl_bch_t hcl_ooch_t;
|
||||
typedef hcl_bci_t hcl_ooci_t;
|
||||
typedef hcl_bcs_t hcl_oocs_t;
|
||||
# define HCL_OOCH_IS_BCH
|
||||
#else
|
||||
#if defined(HCL_ENABLE_UNICODE)
|
||||
typedef hcl_uch_t hcl_ooch_t;
|
||||
typedef hcl_uci_t hcl_ooci_t;
|
||||
typedef hcl_ucs_t hcl_oocs_t;
|
||||
# define HCL_OOCH_IS_UCH
|
||||
#else
|
||||
typedef hcl_bch_t hcl_ooch_t;
|
||||
typedef hcl_bci_t hcl_ooci_t;
|
||||
typedef hcl_bcs_t hcl_oocs_t;
|
||||
# define HCL_OOCH_IS_BCH
|
||||
#endif
|
||||
|
||||
|
||||
/* =========================================================================
|
||||
* TIME-RELATED TYPES
|
||||
* =========================================================================*/
|
||||
|
@ -1006,7 +1006,6 @@ struct hcl_t
|
||||
|
||||
/* == NEVER CHANGE THE ORDER OF FIELDS BELOW == */
|
||||
/* hcl_ignite() assumes this order. make sure to update symnames in ignite_3() */
|
||||
hcl_oop_t _class; /* Class */
|
||||
hcl_oop_t _character;
|
||||
hcl_oop_t _small_integer; /* SmallInteger */
|
||||
hcl_oop_t _large_positive_integer; /* LargePositiveInteger */
|
||||
|
@ -436,7 +436,7 @@ reswitch:
|
||||
/* get the length */
|
||||
for (bslen = 0; bsp[bslen]; bslen++);
|
||||
|
||||
if (hcl_convbtooochars (hcl, bsp, &bslen, HCL_NULL, &slen) <= -1) goto oops;
|
||||
if (hcl_convbtooochars(hcl, bsp, &bslen, HCL_NULL, &slen) <= -1) goto oops;
|
||||
|
||||
/* slen holds the length after conversion */
|
||||
n = slen;
|
||||
@ -505,7 +505,7 @@ reswitch:
|
||||
/* get the length */
|
||||
for (uslen = 0; usp[uslen]; uslen++);
|
||||
|
||||
if (hcl_convutooochars (hcl, usp, &uslen, HCL_NULL, &slen) <= -1) goto oops;
|
||||
if (hcl_convutooochars(hcl, usp, &uslen, HCL_NULL, &slen) <= -1) goto oops;
|
||||
|
||||
/* slen holds the length after conversion */
|
||||
n = slen;
|
||||
|
11
lib/obj.c
11
lib/obj.c
@ -468,31 +468,22 @@ int hcl_equalobjs (hcl_t* hcl, hcl_oop_t rcv, hcl_oop_t arg)
|
||||
case HCL_OOP_TAG_SMOOI:
|
||||
return HCL_OOP_TO_SMOOI(rcv) == HCL_OOP_TO_SMOOI(arg)? 1: 0;
|
||||
|
||||
#if 0
|
||||
case HCL_OOP_TAG_SMPTR:
|
||||
return HCL_OOP_TO_SMPTR(rcv) == HCL_OOP_TO_SMPTR(arg)? 1: 0;
|
||||
#endif
|
||||
|
||||
case HCL_OOP_TAG_CHAR:
|
||||
return HCL_OOP_TO_CHAR(rcv) == HCL_OOP_TO_CHAR(arg)? 1: 0;
|
||||
|
||||
#if 0
|
||||
case HCL_OOP_TAG_ERROR:
|
||||
return HCL_OOP_TO_ERROR(rcv) == HCL_OOP_TO_ERROR(arg)? 1: 0;
|
||||
#endif
|
||||
|
||||
default:
|
||||
{
|
||||
HCL_ASSERT (hcl, HCL_OOP_IS_POINTER(rcv));
|
||||
|
||||
if (HCL_OBJ_GET_CLASS(rcv) != HCL_OBJ_GET_CLASS(arg)) return 0; /* different class, not equal */
|
||||
if (HCL_OBJ_GET_FLAGS_BRAND(rcv) != HCL_OBJ_GET_FLAGS_BRAND(arg)) return 0; /* different class, not equal */
|
||||
HCL_ASSERT (hcl, HCL_OBJ_GET_FLAGS_TYPE(rcv) == HCL_OBJ_GET_FLAGS_TYPE(arg));
|
||||
|
||||
if (HCL_OBJ_GET_CLASS(rcv) == hcl->_class && rcv != arg)
|
||||
{
|
||||
/* a class object are supposed to be unique */
|
||||
return 0;
|
||||
}
|
||||
if (HCL_OBJ_GET_SIZE(rcv) != HCL_OBJ_GET_SIZE(arg)) return 0; /* different size, not equal */
|
||||
|
||||
switch (HCL_OBJ_GET_FLAGS_TYPE(rcv))
|
||||
|
@ -268,6 +268,8 @@ HAVE_CXX = @HAVE_CXX@
|
||||
HCL_PROJECT_AUTHOR = @HCL_PROJECT_AUTHOR@
|
||||
HCL_PROJECT_URL = @HCL_PROJECT_URL@
|
||||
HCL_SIZEOF_CHAR = @HCL_SIZEOF_CHAR@
|
||||
HCL_SIZEOF_CHAR16_T = @HCL_SIZEOF_CHAR16_T@
|
||||
HCL_SIZEOF_CHAR32_T = @HCL_SIZEOF_CHAR32_T@
|
||||
HCL_SIZEOF_DOUBLE = @HCL_SIZEOF_DOUBLE@
|
||||
HCL_SIZEOF_FLOAT = @HCL_SIZEOF_FLOAT@
|
||||
HCL_SIZEOF_INT = @HCL_SIZEOF_INT@
|
||||
|
Loading…
Reference in New Issue
Block a user