This commit is contained in:
hyung-hwan 2008-07-21 21:49:09 +00:00
parent b212e413bd
commit a2d5d649ba
6 changed files with 49 additions and 44 deletions

32
ase/configure vendored
View File

@ -24665,7 +24665,7 @@ _ACEOF
{ echo "$as_me:$LINENO: checking for void *" >&5 { echo "$as_me:$LINENO: checking for void *" >&5
echo $ECHO_N "checking for void *... $ECHO_C" >&6; } echo $ECHO_N "checking for void *... $ECHO_C" >&6; }
if test "${ac_cv_type_voidp+set}" = set; then if test "${ac_cv_type_void_p+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
@ -24704,18 +24704,18 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
test -z "$ac_c_werror_flag" || test -z "$ac_c_werror_flag" ||
test ! -s conftest.err test ! -s conftest.err
} && test -s conftest.$ac_objext; then } && test -s conftest.$ac_objext; then
ac_cv_type_voidp=yes ac_cv_type_void_p=yes
else else
echo "$as_me: failed program was:" >&5 echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_type_voidp=no ac_cv_type_void_p=no
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
{ echo "$as_me:$LINENO: result: $ac_cv_type_voidp" >&5 { echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5
echo "${ECHO_T}$ac_cv_type_voidp" >&6; } echo "${ECHO_T}$ac_cv_type_void_p" >&6; }
# The cast to long int works around a bug in the HP C Compiler # 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 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
@ -24723,7 +24723,7 @@ echo "${ECHO_T}$ac_cv_type_voidp" >&6; }
# This bug is HP SR number 8606223364. # This bug is HP SR number 8606223364.
{ echo "$as_me:$LINENO: checking size of void *" >&5 { echo "$as_me:$LINENO: checking size of void *" >&5
echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } echo $ECHO_N "checking size of void *... $ECHO_C" >&6; }
if test "${ac_cv_sizeof_voidp+set}" = set; then if test "${ac_cv_sizeof_void_p+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6 echo $ECHO_N "(cached) $ECHO_C" >&6
else else
if test "$cross_compiling" = yes; then if test "$cross_compiling" = yes; then
@ -24966,15 +24966,15 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
done done
case $ac_lo in case $ac_lo in
?*) ac_cv_sizeof_voidp=$ac_lo;; ?*) ac_cv_sizeof_void_p=$ac_lo;;
'') if test "$ac_cv_type_voidp" = yes; then '') if test "$ac_cv_type_void_p" = yes; then
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
See \`config.log' for more details." >&5 See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (void *) echo "$as_me: error: cannot compute sizeof (void *)
See \`config.log' for more details." >&2;} See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; } { (exit 77); exit 77; }; }
else else
ac_cv_sizeof_voidp=0 ac_cv_sizeof_void_p=0
fi ;; fi ;;
esac esac
else else
@ -25037,34 +25037,34 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
ac_status=$? ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then (exit $ac_status); }; }; then
ac_cv_sizeof_voidp=`cat conftest.val` ac_cv_sizeof_void_p=`cat conftest.val`
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5 echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) ( exit $ac_status )
if test "$ac_cv_type_voidp" = yes; then if test "$ac_cv_type_void_p" = yes; then
{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *)
See \`config.log' for more details." >&5 See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute sizeof (void *) echo "$as_me: error: cannot compute sizeof (void *)
See \`config.log' for more details." >&2;} See \`config.log' for more details." >&2;}
{ (exit 77); exit 77; }; } { (exit 77); exit 77; }; }
else else
ac_cv_sizeof_voidp=0 ac_cv_sizeof_void_p=0
fi fi
fi fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f conftest.val rm -f conftest.val
fi fi
{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_voidp" >&5 { echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5
echo "${ECHO_T}$ac_cv_sizeof_voidp" >&6; } echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; }
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define SIZEOF_VOIDP $ac_cv_sizeof_voidp #define SIZEOF_VOID_P $ac_cv_sizeof_void_p
_ACEOF _ACEOF
@ -26790,7 +26790,7 @@ else
enable_wchar_is=yes enable_wchar_is=yes
fi fi
"${ac_cv_sizeof_wchar_t}" = "0" && enable_wchar_is=no test "${ac_cv_sizeof_wchar_t}" = "0" && enable_wchar_is=no
if test "$enable_wchar_is" = "yes" if test "$enable_wchar_is" = "yes"
then then

View File

@ -93,6 +93,7 @@ AC_CHECK_SIZEOF(__int16)
AC_CHECK_SIZEOF(__int32) AC_CHECK_SIZEOF(__int32)
AC_CHECK_SIZEOF(__int64) AC_CHECK_SIZEOF(__int64)
AC_CHECK_SIZEOF(__int128) AC_CHECK_SIZEOF(__int128)
dnl AC_CHECK_SIZEOF doesn't work without white-space between void and *
AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(float) AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double) AC_CHECK_SIZEOF(double)
@ -124,7 +125,7 @@ AC_DEFINE_UNQUOTED(ASE_PKGAUTHOR,"${PACKAGE_BUGREPORT}", [author's email address
AC_ARG_ENABLE([wchar], [AC_HELP_STRING([--enable-wchar], AC_ARG_ENABLE([wchar], [AC_HELP_STRING([--enable-wchar],
[use wchar_t a default charater type when enabled (default. yes)])], [use wchar_t a default charater type when enabled (default. yes)])],
enable_wchar_is=$enableval,enable_wchar_is=yes) enable_wchar_is=$enableval,enable_wchar_is=yes)
[ "${ac_cv_sizeof_wchar_t}" = "0" ] && enable_wchar_is=no test "${ac_cv_sizeof_wchar_t}" = "0" && enable_wchar_is=no
if test "$enable_wchar_is" = "yes" if test "$enable_wchar_is" = "yes"
then then
AC_DEFINE([ASE_CHAR_IS_WCHAR],[],[char is wchar]) AC_DEFINE([ASE_CHAR_IS_WCHAR],[],[char is wchar])

View File

@ -1,5 +1,5 @@
/* /*
* $Id: awk.h 271 2008-07-20 12:42:39Z baconevi $ * $Id: awk.h 278 2008-07-21 03:49:09Z baconevi $
* *
* {License} * {License}
*/ */
@ -603,7 +603,9 @@ ase_awk_t* ase_awk_open (
/* memory manager */ /* memory manager */
ase_mmgr_t* mmgr, ase_mmgr_t* mmgr,
/* size of extension area to allocate in bytes */ /* size of extension area to allocate in bytes */
unsigned int extension ase_size_t extension,
/* memory manager fuser */
ase_fuser_t mmgr_fuser
); );
/* /*

View File

@ -148,7 +148,7 @@
#undef SIZEOF_SHORT #undef SIZEOF_SHORT
/* The size of `void *', as computed by sizeof. */ /* The size of `void *', as computed by sizeof. */
#undef SIZEOF_VOIDP #undef SIZEOF_VOID_P
/* The size of `wchar_t', as computed by sizeof. */ /* The size of `wchar_t', as computed by sizeof. */
#undef SIZEOF_WCHAR_T #undef SIZEOF_WCHAR_T

View File

@ -1,5 +1,5 @@
/* /*
* $Id: types.h 225 2008-06-26 06:48:38Z baconevi $ * $Id: types.h 278 2008-07-21 03:49:09Z baconevi $
* *
* {License} * {License}
*/ */
@ -314,6 +314,10 @@ typedef int ase_mcint_t;
#endif #endif
#endif #endif
/* a fuser should fuse(copy and combine) the orginal data into the given space
* and return the pointer to its new location in the space */
typedef void* (*ase_fuser_t) (void* org, void* space, ase_size_t size);
typedef struct ase_cstr_t ase_cstr_t; typedef struct ase_cstr_t ase_cstr_t;
typedef struct ase_mmgr_t ase_mmgr_t; typedef struct ase_mmgr_t ase_mmgr_t;
typedef struct ase_ccls_t ase_ccls_t; typedef struct ase_ccls_t ase_ccls_t;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: awk.c 276 2008-07-20 13:52:30Z baconevi $ * $Id: awk.c 278 2008-07-21 03:49:09Z baconevi $
* *
* {License} * {License}
*/ */
@ -24,7 +24,8 @@ static void free_bfn (void* awk, void* afn);
ase_awk_seterror ((awk), (code), (line), &errarg, 1); \ ase_awk_seterror ((awk), (code), (line), &errarg, 1); \
} while (0) } while (0)
ase_awk_t* ase_awk_open (ase_mmgr_t* mmgr, unsigned int extension, extension_initializer) ase_awk_t* ase_awk_open (
ase_mmgr_t* mmgr, ase_size_t extension, ase_fuser_t mmgr_fuser)
{ {
ase_awk_t* awk; ase_awk_t* awk;
@ -36,12 +37,9 @@ ase_awk_t* ase_awk_open (ase_mmgr_t* mmgr, unsigned int extension, extension_ini
if (awk == ASE_NULL) return ASE_NULL; if (awk == ASE_NULL) return ASE_NULL;
ase_memset (awk, 0, ASE_SIZEOF(ase_awk_t) + extension); ase_memset (awk, 0, ASE_SIZEOF(ase_awk_t) + extension);
if (mmgr_fuser) mmgr = mmgr_fuser (mmgr, awk + 1, extension);
awk->mmgr = mmgr; awk->mmgr = mmgr;
// TODO: extension_initializer???????????????????????????????/
if (extension_initializer)
extension_initializer (awk, awk + 1, extension);
if (ase_str_open (&awk->token.name, 128, mmgr) == ASE_NULL) if (ase_str_open (&awk->token.name, 128, mmgr) == ASE_NULL)
{ {
ASE_AWK_FREE (awk, awk); ASE_AWK_FREE (awk, awk);