X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=m4%2Fpsi%2Fpsi_decl.m4;h=d699dd80d2db65345115003fd71afe5a8cbc0336;hb=94fbb0d3c33da9d9e55a2d5b61a6e260da5b002c;hp=3cf8cc286ceb8e8180ed4a6a3d1af1f983b9c8bc;hpb=3ef8c66ab1300801bcdb15b43f9f28e77b6487b6;p=m6w6%2Fext-psi diff --git a/m4/psi/psi_decl.m4 b/m4/psi/psi_decl.m4 index 3cf8cc2..d699dd8 100644 --- a/m4/psi/psi_decl.m4 +++ b/m4/psi/psi_decl.m4 @@ -1,38 +1,22 @@ # psi_add_redir(name, symbol) -# Add a function redirection to $PSI_REDIRS. +# Add a function redirection to $PSI_REDIRS_H. psi_add_redir() { - cat >>$PSI_REDIRS <>$PSI_FN_DECLS <>$PSI_VA_DECLS <>$PSI_DECLS <@@:>@+U / {print$[]3; exit}'` - ]) - psi_cv_libc_main=$psi_libc_main - ]) -]) - -dnl PSI_DECL_ARGS(decl args) +dnl PSI_DECL_ARGS(decl func, decl args, options) dnl INTERNAL: build psi_decl_args AC_DEFUN(PSI_DECL_ARGS, [ psi_decl_args= - PSI_DECL_ARG($1) + PSI_DECL_ARG([$1], [$3]) m4_case([$2], [(void)], [], [()], [], [], [], - [m4_map_args_sep([PSI_DECL_ARG(m4_normalize(], [))], [], m4_bregexp([$2], [(\(.*\))], [\1]))]) + [m4_map_args_sep( + [PSI_DECL_ARG(m4_normalize(], + [), [0])], [], m4_bregexp([$2], [(\(.*\))], [\1]))]) ]) -dnl PSI_DECL_ARG(decl arg) +dnl PSI_DECL_ARG(decl arg, options) dnl INTERNAL: build psi_decl_args AC_DEFUN(PSI_DECL_ARG, [ - m4_define([member_name], PSI_VAR_NAME($1)) - m4_define([member_type], PSI_VAR_TYPE($1)) + m4_define([member_name], PSI_VAR_NAME([$1])) + m4_define([member_type], PSI_VAR_TYPE([$1])) PSI_TYPE_INDIRECTION([$1],, pl, as) if test -n "$psi_decl_args"; then psi_decl_args="$psi_decl_args, " fi - psi_decl_args="[$psi_decl_args{]PSI_TYPE_PAIR(member_type)[, \"]member_name[\",] $pl, $as[}]" + psi_decl_args="[$psi_decl_args{]ifelse([$2],,DECL_KIND_STD,[ifelse([$2],0,0,AS_TR_CPP([DECL_KIND_$2]))])[, ]PSI_TYPE_PAIR(member_type)[, \"]member_name[\",] $pl, $as[}]" ]) dnl PSI_DECL(type func, args, flags, libs) dnl Check for a function or macro declaration and a possible asm redirection. -dnl Adds a pre-defined (vararg) decl to $PSI_VA_DECLS/$PSI_DECLS. +dnl Adds a pre-defined (vararg) decl to $PSI_VA_DECLS_H/$PSI_DECLS_H. dnl Calls PSI_MACRO if PSI_FUNC fails. AC_DEFUN(PSI_DECL, [ - AC_REQUIRE([PSI_FUNC_LIBC_MAIN])dnl - - PSI_DECL_ARGS($1, $2) + PSI_DECL_ARGS($1, $2, $3) psi_symbol="PSI_VAR_NAME($1)" AC_CACHE_CHECK(for PSI_VAR_NAME($1), [psi_cv_fn_]PSI_VAR_NAME($1), [ @@ -136,7 +107,7 @@ AC_DEFUN(PSI_DECL, [ then PSI_REDIR($psi_symbol) fi - psi_add_decl "$psi_decl_args" $3 + psi_add_decl "$psi_decl_args" ;; esac ;; @@ -151,7 +122,7 @@ AC_DEFUN(PSI_DECL, [ ;; *) PSI_REDIR($psi_symbol) - psi_add_decl "$psi_decl_args" $3 + psi_add_decl "$psi_decl_args" ;; esac ])