Changeset 507 in svn


Ignore:
Timestamp:
2008-01-05T10:12:31+01:00 (8 years ago)
Author:
Xuefer
Message:

PHP_6: unicode support for get set etc handlers

Location:
trunk/processor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/head.m4

    r480 r507  
    216216#ifdef ZEND_ENGINE_2
    217217/* fix method on store */
    218 static void xc_fix_method(xc_processor_t *processor, zend_op_array *dst) /* {{{ */
     218static void xc_fix_method(xc_processor_t *processor, zend_op_array *dst TSRMLS_DC) /* {{{ */
    219219{
    220220    zend_function *zf = (zend_function *) dst;
    221221    zend_class_entry *ce = processor->active_class_entry_dst;
     222    const zend_class_entry *srcce = processor->active_class_entry_src;
    222223
    223224    /* Fixing up the default functions for objects here since
     
    240241    }
    241242    else {
    242 dnl FIXME: handle common.function_name here
    243 #define SET_IF_SAME_NAME(member) \
    244         do { \
    245             if (!strcasecmp(ZSTR_S(zf->common.function_name), #member)) { \
    246                 ce->member = zf; \
    247             } \
    248         } \
    249         while(0)
    250         /* if(ce->member && !strcmp(zf->common.function_name, ce->member->common.function_name)) { \ */
    251 
     243    pushdef(`SET_IF_SAME_NAMEs', `
    252244        SET_IF_SAME_NAME(__get);
    253245        SET_IF_SAME_NAME(__set);
     
    263255        SET_IF_SAME_NAME(__tostring);
    264256#endif
    265 
     257    ')
     258#ifdef IS_UNICODE
     259        if (UG(unicode)) {
     260#define SET_IF_SAME_NAME(member) \
     261            do { \
     262                if (srcce->member && u_strcmp(ZSTR_S(zf->common.function_name), ZSTR_S(srcce->member->common.function_name)) == 0) { \
     263                    ce->member = zf; \
     264                } \
     265            } \
     266            while(0)
     267
     268            SET_IF_SAME_NAMEs()
    266269#undef SET_IF_SAME_NAME
     270        }
     271        else
     272#endif
     273        do {
     274#define SET_IF_SAME_NAME(member) \
     275            do { \
     276                if (srcce->member && strcmp(ZSTR_S(zf->common.function_name), ZSTR_S(srcce->member->common.function_name)) == 0) { \
     277                    ce->member = zf; \
     278                } \
     279            } \
     280            while(0)
     281
     282            SET_IF_SAME_NAMEs()
     283#undef SET_IF_SAME_NAME
     284        } while (0);
     285
     286    popdef(`SET_IF_SAME_NAMEs')
     287
    267288    }
    268289}
  • trunk/processor/processor.m4

    r506 r507  
    668668#endif
    669669
    670     IFRESTORE(`
    671 #ifdef ZEND_ENGINE_2
     670#ifdef ZEND_ENGINE_2
     671    PROC_CLASS_ENTRY_P(scope)
     672    IFCOPY(`
    672673        if (src->scope) {
    673             dst->scope = xc_get_class(processor, (zend_ulong) src->scope);
    674             xc_fix_method(processor, dst);
    675         }
    676         DONE(scope)
    677 #endif
    678     ', `
    679 #ifdef ZEND_ENGINE_2
    680         PROC_CLASS_ENTRY_P(scope)
    681 #endif
    682     ')
     674            xc_fix_method(processor, dst TSRMLS_CC);
     675        }
     676    ')
     677#endif
    683678
    684679    IFRESTORE(`
Note: See TracChangeset for help on using the changeset viewer.