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

PHP_6: unicode support for get set etc handlers

File:
1 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} 
Note: See TracChangeset for help on using the changeset viewer.