struct member fixes
[m6w6/ext-psi] / m4 / psi_type.m4
index dad3b676d540ae2692895270f442580feed486d9..7e4badbbbacb4bf3ab26e24d5c6aa4214d04e969 100644 (file)
@@ -36,7 +36,7 @@ dnl "uint"), AX_CHECK_SIGN is used to discover signedness of the type.
 dnl Defines a pre-defined type in $PSI_TYPES.
 AC_DEFUN(PSI_TYPE, [
        ifdef(AS_TR_CPP(AC_TYPE_$1), AS_TR_CPP(AC_TYPE_$1))
-       PSI_CHECK_SIZEOF($1, PSI_INCLUDES)
+       PSI_CHECK_SIZEOF($1)
        psi_basic_type=AS_TR_SH($2)
        case $psi_basic_type in
        int)
@@ -49,10 +49,13 @@ AC_DEFUN(PSI_TYPE, [
        if test "$2" && PSI_SH_TEST_SIZEOF($1); then
                AS_TR_SH(psi_basic_type_$1)=$psi_basic_type
                psi_add_type "{`psi_type_pair $psi_basic_type $AS_TR_SH([ac_cv_sizeof_]$1)`, \"$1\"}"
-               #cat >>$PSI_TYPES <<<"{`psi_type_pair $psi_basic_type $AS_TR_SH([ac_cv_sizeof_]$1)`, \"$1\"}, "
        fi
 ])
 
+dnl PSI_SH_BASIC_TYPE(type)
+dnl Expand to the basic type (int/uint) of a distinct type
+AC_DEFUN(PSI_SH_BASIC_TYPE, [$AS_TR_SH([psi_basic_type_]$1)])
+
 dnl PSI_OPAQUE_TYPE(type name)
 dnl Checks a type for being a scalar, a struct or a pointer type.
 dnl Calls AC_TYPE_<TYPE> (if defined) and PSI_CHECK_SIZEOF.
@@ -60,7 +63,7 @@ dnl Defines a pre-defined type in $PSI_TYPES and a pre-defined struct in
 dnl $PSI_STRUCTS if the type is a struct.
 AC_DEFUN(PSI_OPAQUE_TYPE, [
        ifdef(AS_TR_CPP(AC_TYPE_$1), AS_TR_CPP(AC_TYPE_$1))
-       PSI_CHECK_SIZEOF($1, PSI_INCLUDES)
+       PSI_CHECK_SIZEOF($1)
        if PSI_SH_TEST_SIZEOF($1); then
                psi_type_class=
                AC_CACHE_CHECK(type class of $1, AS_TR_SH([psi_cv_type_class_]$1), [
@@ -83,14 +86,12 @@ AC_DEFUN(PSI_OPAQUE_TYPE, [
                scalar)
                        AX_CHECK_SIGN($1, [psi_basic_type=int], [psi_basic_type=uint], PSI_INCLUDES)
                        psi_add_type "{`psi_type_pair $psi_basic_type $AS_TR_SH([ac_cv_sizeof_]$1)`, \"$1\"}"
-                       #cat >>$PSI_TYPES <<<"  {`psi_type_pair $psi_basic_type $AS_TR_SH([ac_cv_sizeof_]$1)`, \"$1\"}, "
                        ;;
                struct)
                        PSI_STRUCT($1)
                        ;;
                pointer*)
                        psi_add_type "{PSI_T_POINTER, \"void\", \"$1\"}"
-                       #cat >>$PSI_TYPES <<<"  {PSI_T_POINTER, \"void\", \"$1\"}, "
                        ;;
                *)
                        AC_MSG_WARN(could not detect type class of $1)