build: PHP<7.2 compatibility
[m6w6/ext-psi] / src / libjit.c
index da8f25e5ae2dbc786251a01dd1fc6f40164fe4a7..a32742a1f709e05649ceee603a0f2fc8a8960522 100644 (file)
@@ -36,13 +36,19 @@ static inline jit_type_t psi_jit_decl_arg_type(struct psi_decl_arg *darg);
 
 static inline jit_abi_t psi_jit_abi(const char *convention)
 {
+       if (!strcasecmp(convention, "stdcall")) {
+               return jit_abi_stdcall;
+       }
+       if (!strcasecmp(convention, "fastcall")) {
+               return jit_abi_fastcall;
+       }
        return jit_abi_cdecl;
 }
 static inline jit_type_t psi_jit_token_type(token_t t)
 {
        switch (t) {
        default:
-               ZEND_ASSERT(0);
+               assert(0);
                /* no break */
        case PSI_T_VOID:
                return jit_type_void;
@@ -155,7 +161,7 @@ static unsigned psi_jit_struct_type_elements(struct psi_decl_struct *strct,
        /* apply struct alignment padding */
        offset = (offset + maxalign - 1) & ~(maxalign - 1);
 
-       ZEND_ASSERT(offset <= strct->size);
+       assert(offset <= strct->size);
        if (offset < strct->size) {
                nels += psi_jit_struct_type_pad(&(*fields)[nels], strct->size - offset);
        }
@@ -517,7 +523,7 @@ static void psi_jit_call_va(struct psi_context *C, struct psi_call_frame *frame,
        signature = jit_type_create_signature(jit_abi_vararg,
                        jit_type_get_return(info->signature), param_types, argc + va_count,
                        1);
-       ZEND_ASSERT(signature);
+       assert(signature);
 
        info->impl.fn.frame = frame;
        jit_apply(signature, decl->sym, args, argc, rval);