bison
[m6w6/ext-psi] / m4 / psi / psi_type.m4
index a55e6affcb2741b5dd5955d6ea37c218cb7eb146..b3940a4617e45a3915fe0e7767e426c3a8b7a48a 100644 (file)
@@ -1,15 +1,13 @@
 # psi_add_type(type triplet)
-# Add a pre-defined type to $PSI_TYPES.
+# Add a pre-defined type to $PSI_TYPES_H.
 psi_add_type() {
-       cat >>$PSI_TYPES <<EOF
-       $1,
-EOF
+       PSI_TYPES="$PSI_TYPES
+       $1,"
 }
 
 psi_add_stdtype() {
-       cat >>$PSI_STDTYPES <<EOF
-       $1,
-EOF
+       PSI_STDTYPES="$PSI_STDTYPES
+       $1,"
 }
 
 # psi_type_pair(type, size)
@@ -47,7 +45,7 @@ dnl Check for a specific type, optionally referring to a basic type.
 dnl Calls AC_TYPE_<TYPE> (if defined) and PSI_CHECK_SIZEOF.
 dnl If the basic type is just specified as "int" (in contrast to "sint" or
 dnl "uint"), AX_CHECK_SIGN is used to discover signedness of the type.
-dnl Defines a pre-defined type in $PSI_TYPES.
+dnl Defines a pre-defined type in $PSI_TYPES_H.
 AC_DEFUN(PSI_TYPE, [
        ifdef(AS_TR_CPP(AC_TYPE_$1), AS_TR_CPP(AC_TYPE_$1))
        PSI_CHECK_SIZEOF($1)
@@ -90,7 +88,7 @@ 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.
-dnl Defines a pre-defined type in $PSI_TYPES and a pre-defined struct in
+dnl Defines a pre-defined type in $PSI_TYPES_H 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))
@@ -137,12 +135,10 @@ AC_DEFUN(PSI_FUNCTOR_TYPE, [
        dnl psi_add_type "{PSI_T_POINTER, \"void\", \"PSI_VAR_NAME($1)\"}"
        AS_TR_SH([ac_cv_sizeof_]PSI_VAR_NAME($1))=PSI_SH_SIZEOF(void *)
        PSI_DECL_TYPE([$1], [$2])
-       if test "$PHP_DEBUG" = "1"; then
-               AC_CHECK_TYPE(PSI_VAR_NAME($1), [], [
-                       psi_add_macro ["#undef ]PSI_VAR_NAME($1)["]
-                       psi_add_macro ["typedef ]PSI_VAR_TYPE($1)[ (*]PSI_VAR_NAME($1)[)]$2;"
-               ])
-       fi
+       AC_CHECK_TYPE(PSI_VAR_NAME($1), [], [
+               psi_add_macro ["#undef ]PSI_VAR_NAME($1)["]
+               psi_add_macro ["typedef ]PSI_VAR_TYPE($1)[ (*]PSI_VAR_NAME($1)[)]$2;"
+       ])
 ])
 
 dnl PSI_VAR_TYPE(decl arg)
@@ -247,8 +243,12 @@ AC_DEFUN(PSI_CHECK_STD_TYPES, [
        PSI_STDTYPE(short int, int)
        PSI_STDTYPE(signed short, int)
        PSI_STDTYPE(signed short int, int)
+       PSI_STDTYPE(short signed, int)
+       PSI_STDTYPE(short signed int, int)
        PSI_STDTYPE(unsigned short, uint)
        PSI_STDTYPE(unsigned short int, uint)
+       PSI_STDTYPE(short unsigned, uint)
+       PSI_STDTYPE(short unsigned int, uint)
        PSI_STDTYPE(int, int)
        AC_CHECK_ALIGNOF(int)
        PSI_STDTYPE(signed int, int)
@@ -259,14 +259,25 @@ AC_DEFUN(PSI_CHECK_STD_TYPES, [
        AC_CHECK_ALIGNOF(long)
        PSI_STDTYPE(long int, int)
        PSI_STDTYPE(signed long int, int)
+       PSI_STDTYPE(long signed int, int)
        PSI_STDTYPE(unsigned long, uint)
        PSI_STDTYPE(unsigned long int, uint)
+       PSI_STDTYPE(long unsigned, uint)
+       PSI_STDTYPE(long unsigned int, uint)
        PSI_STDTYPE(long long, int)
        AC_CHECK_ALIGNOF(long long)
        PSI_STDTYPE(signed long long, int)
        PSI_STDTYPE(signed long long int, int)
+       PSI_STDTYPE(long signed long, int)
+       PSI_STDTYPE(long signed long int, int)
+       PSI_STDTYPE(long long signed, int)
+       PSI_STDTYPE(long long signed int, int)
        PSI_STDTYPE(unsigned long long, uint)
        PSI_STDTYPE(unsigned long long int, uint)
+       PSI_STDTYPE(long unsigned long, uint)
+       PSI_STDTYPE(long unsigned long int, uint)
+       PSI_STDTYPE(long long unsigned, uint)
+       PSI_STDTYPE(long long unsigned int, uint)
        dnl this must come after the check for "unsigned long long int"; autoconf, wth?
        PSI_STDTYPE(long long int, int)
 ])