Changeset 726 in svn for branches/1.3/processor/main.m4


Ignore:
Timestamp:
2011-04-09T14:59:31+02:00 (4 years ago)
Author:
Xuefer
Message:

merge from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/processor/main.m4

    r691 r726  
    164164dnl }}}
    165165dnl {{{ COPYNULL(1:elm)
    166 # foreach(VAR, (LIST), STMT)
    167 m4_define([foreach],
    168        [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])
    169 m4_define([_arg1], [$1])
    170 m4_define([_foreach],
    171        [ifelse([$2], [()], ,
    172        [m4_define([$1], _arg1$2)$3[]_foreach([$1],
    173                                                        (shift$2),
    174                                                        [$3])])])
    175166define(`COPYNULL', `
    176167    COPYNULL_EX(`dst->$1', `$2')DONE(`$1')
     
    195186dnl }}}
    196187dnl {{{ DONE_*
    197 define(`DONE_SIZE', `IFASSERT(`
     188define(`DONE_SIZE', `IFASSERT(`dnl
    198189    done_size += $1`';
    199190    done_count ++;
    200191')')
    201192define(`DONE', `
    202     define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,$1')
     193    define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,"$1"')
     194    IFASSERT(`dnl
     195        if (zend_hash_exists(&done_names, "$1", sizeof("$1"))) {
     196            fprintf(stderr
     197                , "duplicate field at %s `#'%d FUNC_NAME`' : %s\n"
     198                , __FILE__, __LINE__
     199                , "$1"
     200                );
     201        }
     202        else {
     203            zend_uchar b = 1;
     204            zend_hash_add(&done_names, "$1", sizeof("$1"), (void*)&b, sizeof(b), NULL);
     205        }
     206    ')
    203207    DONE_SIZE(`sizeof(src->$1)')
    204208')
Note: See TracChangeset for help on using the changeset viewer.