Changeset 622 in svn for branches/1.3/processor/head.m4


Ignore:
Timestamp:
2009-07-05T08:18:06Z (6 years ago)
Author:
Xuefer
Message:

merged r504:513 from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/processor/head.m4

    r494 r622  
    114114static inline int xc_zstrlen_uchar(zstr s)
    115115{
    116     int i;
    117     UChar *p = ZSTR_U(s);
    118     for (i = 0; *p; i ++, p++) {
    119         /* empty */
    120     }
    121     return i;
     116    return u_strlen(ZSTR_U(s));
    122117}
    123118/* }}} */
     
    215210#ifdef ZEND_ENGINE_2
    216211/* fix method on store */
    217 static void xc_fix_method(xc_processor_t *processor, zend_op_array *dst) /* {{{ */
     212static void xc_fix_method(xc_processor_t *processor, zend_op_array *dst TSRMLS_DC) /* {{{ */
    218213{
    219214    zend_function *zf = (zend_function *) dst;
    220215    zend_class_entry *ce = processor->active_class_entry_dst;
     216    const zend_class_entry *srcce = processor->active_class_entry_src;
    221217
    222218    /* Fixing up the default functions for objects here since
     
    239235    }
    240236    else {
    241 dnl FIXME: handle common.function_name here
    242 #define SET_IF_SAME_NAME(member) \
    243         do { \
    244             if (!strcasecmp(ZSTR_S(zf->common.function_name), #member)) { \
    245                 ce->member = zf; \
    246             } \
    247         } \
    248         while(0)
    249         /* if(ce->member && !strcmp(zf->common.function_name, ce->member->common.function_name)) { \ */
    250 
     237    pushdef(`SET_IF_SAME_NAMEs', `
    251238        SET_IF_SAME_NAME(__get);
    252239        SET_IF_SAME_NAME(__set);
     
    262249        SET_IF_SAME_NAME(__tostring);
    263250#endif
    264 
     251    ')
     252#ifdef IS_UNICODE
     253        if (UG(unicode)) {
     254#define SET_IF_SAME_NAME(member) \
     255            do { \
     256                if (srcce->member && u_strcmp(ZSTR_U(zf->common.function_name), ZSTR_U(srcce->member->common.function_name)) == 0) { \
     257                    ce->member = zf; \
     258                } \
     259            } \
     260            while(0)
     261
     262            SET_IF_SAME_NAMEs()
    265263#undef SET_IF_SAME_NAME
     264        }
     265        else
     266#endif
     267        do {
     268#define SET_IF_SAME_NAME(member) \
     269            do { \
     270                if (srcce->member && strcmp(ZSTR_S(zf->common.function_name), ZSTR_S(srcce->member->common.function_name)) == 0) { \
     271                    ce->member = zf; \
     272                } \
     273            } \
     274            while(0)
     275
     276            SET_IF_SAME_NAMEs()
     277#undef SET_IF_SAME_NAME
     278        } while (0);
     279
     280    popdef(`SET_IF_SAME_NAMEs')
     281
    266282    }
    267283}
Note: See TracChangeset for help on using the changeset viewer.