X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Ftypes%2Fdecl.c;h=df04656a8d41bab720b53a362ed018aa12701f94;hp=5ab3664d55bb83738534545b21232a020ff9e9f9;hb=c5b2de8ed1d92dd42f910d4347d9175f27e3acbb;hpb=3eb42b54ab141d3b25b6fff0cdec860f93e37617 diff --git a/src/types/decl.c b/src/types/decl.c index 5ab3664..df04656 100644 --- a/src/types/decl.c +++ b/src/types/decl.c @@ -25,26 +25,19 @@ #include "php_psi_stdinc.h" -#if __GNUC__ >= 5 -# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers" -#endif -#include "php_psi_macros.h" -#include "php_psi_redirs.h" -#if __GNUC__ >= 5 -# pragma GCC diagnostic pop -#endif - #include - #include "data.h" -struct psi_decl *psi_decl_init(struct psi_decl_abi *abi, - struct psi_decl_arg *func, struct psi_plist *args) +#define PSI_FUNC_REDIRS +#include "php_psi_posix.h" + +struct psi_decl *psi_decl_init(struct psi_decl_arg *func, struct psi_plist *args) { struct psi_decl *d = calloc(1, sizeof(*d)); - d->abi = abi; + d->func = func; d->args = args; + return d; } @@ -135,7 +128,9 @@ bool psi_decl_validate(struct psi_data *data, struct psi_decl *decl, void *dl) bool psi_decl_validate_nodl(struct psi_data *data, struct psi_decl *decl) { - if (!psi_decl_abi_validate(data, decl->abi)) { + if (!decl->abi) { + decl->abi = psi_decl_abi_init("default"); + } else if (!psi_decl_abi_validate(data, decl->abi)) { data->error(data, decl->abi->token, PSI_WARNING, "Invalid calling convention: '%s'", decl->abi->token->text); return false;