Ignore:
Timestamp:
2011-04-09T12:22:14+02:00 (4 years ago)
Author:
moo
Message:

runtime check for field list assertion to tell which is mismatch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/main.m4

    r715 r719  
    206206dnl }}} 
    207207dnl {{{ DONE_* 
    208 define(`DONE_SIZE', `IFASSERT(` 
     208define(`DONE_SIZE', `IFASSERT(`dnl 
    209209    done_size += $1`'; 
    210210    done_count ++; 
    211211')') 
    212212define(`DONE', ` 
    213     define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,$1') 
     213    define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,"$1"') 
     214    IFASSERT(`dnl 
     215        if (zend_hash_exists(&done_names, "$1", sizeof("$1"))) { 
     216            fprintf(stderr 
     217                , "duplicate field at %s `#'%d FUNC_NAME`' : %s\n" 
     218                , __FILE__, __LINE__ 
     219                , "$1" 
     220                ); 
     221        } 
     222        else { 
     223            zend_uchar b = 1; 
     224            zend_hash_add(&done_names, "$1", sizeof("$1"), (void*)&b, sizeof(b), NULL); 
     225        } 
     226    ') 
    214227    DONE_SIZE(`sizeof(src->$1)') 
    215228') 
Note: See TracChangeset for help on using the changeset viewer.