functor types
[m6w6/ext-psi] / m4 / psi_type.m4
index ef073ca3191f844bb5325a41310ef76ee99556ef..ad2d0001cbc6275d722f0c836d13f318bc65f0a0 100644 (file)
@@ -127,6 +127,14 @@ AC_DEFUN(PSI_OPAQUE_TYPE, [
        fi
 ])
 
+dnl PSI_FUNCTOR_TYPE(type functor_name, args)
+dnl Forwards to PSI_DECL_TYPE.
+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])
+])
+
 dnl PSI_VAR_TYPE(decl arg)
 dnl Extracts the type of a decl arg, e.g. dnl unsigned char* buf[16] -> unsigned char*.
 AC_DEFUN(PSI_VAR_TYPE, [m4_bregexp([$1], [^\(const \)?\(.*\) \([*]*\)[^ ]+$], [\2\3])])