Changeset 4 for trunk/processor/main.m4


Ignore:
Timestamp:
2006-05-13T03:54:55+02:00 (9 years ago)
Author:
moo
Message:

compatibility fix: remove the using of gnu m4 extension

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/main.m4

    r1 r4  
    8787')
    8888dnl }}}
    89 dnl {{{ PROC_CLASS_ENTRY_P
    90 define(`PROC_CLASS_ENTRY_P', `PROC_CLASS_ENTRY_P_EX(`dst->$1', `src->$1')`'DONE(`$1')')
     89dnl {{{ PROC_CLASS_ENTRY_P(1:elm)
     90define(`PROC_CLASS_ENTRY_P', `PROC_CLASS_ENTRY_P_EX(`dst->$1', `src->$1', `$1')`'DONE(`$1')')
     91dnl PROC_CLASS_ENTRY_P_EX(1:dst, 2:src, 3:elm-name)
    9192define(`PROC_CLASS_ENTRY_P_EX', `
    9293    if ($2) {
    9394        IFSTORE(`$1 = (zend_class_entry *) xc_get_class_num(processor, $2);')
    9495        IFRESTORE(`$1 = xc_get_class(processor, (zend_uint) $2);')
    95         IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("patsubst(`$1', `dst->')"), $2->name, strlen($2->name), 1);')
     96        IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), $2->name, strlen($2->name), 1);')
    9697    }
    9798    else {
    98         COPYNULL_EX($1)
     99        COPYNULL_EX(`$1', `$3')
    99100    }
    100101')
     
    132133define(`SETNULL', `SETNULL_EX(`dst->$1')DONE(`$1')')
    133134dnl }}}
    134 dnl {{{ COPYNULL_EX
     135dnl {{{ COPYNULL_EX(1:dst, 2:elm-name)
    135136define(`COPYNULL_EX', `
    136     IFDASM(`add_assoc_null_ex(dst, ZEND_STRS("patsubst(`$1', `dst->')"));')
     137    IFDASM(`add_assoc_null_ex(dst, ZEND_STRS("$2"));')
    137138    IFNOTMEMCPY(`IFCOPY(`$1 = NULL;')')
    138139')
     140dnl }}}
     141dnl {{{ COPYNULL(1:elm)
     142# foreach(VAR, (LIST), STMT)
     143m4_define([foreach],
     144       [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])
     145m4_define([_arg1], [$1])
     146m4_define([_foreach],
     147       [ifelse([$2], [()], ,
     148       [m4_define([$1], _arg1$2)$3[]_foreach([$1],
     149                                                       (shift$2),
     150                                                       [$3])])])
    139151define(`COPYNULL', `
    140     COPYNULL_EX(`dst->$1')DONE(`$1')
     152    COPYNULL_EX(`dst->$1', `$2')DONE(`$1')
     153')
     154dnl }}}
     155dnl {{{ LIST_DIFF(1:left-list, 2:right-list)
     156define(`foreach',
     157       `pushdef(`$1')_foreach(`$1', `$2', `$3')popdef(`$1')')
     158define(`_arg1', `$1')
     159define(`_foreach',                             
     160       `ifelse(`$2', `()', ,                       
     161       `define(`$1', _arg1$2)$3`'_foreach(`$1',
     162                                                       (shift$2),
     163                                                       `$3')')')
     164define(`LIST_DIFF', `dnl
     165foreach(`i', `($1)', `pushdef(`item_'defn(`i'))')dnl allocate variable for items in $1
     166foreach(`i', `($2)', `pushdef(`item_'defn(`i'))undefine(`item_'defn(`i'))')dnl allocate variable for items in $2, and undefine it
     167foreach(`i', `($1)', `ifdef(`item_'defn(`i'), `defn(`i') ')')dnl see what is still defined
     168foreach(`i', `($2)', `popdef(`item_'defn(`i'))')dnl
     169foreach(`i', `($1)', `popdef(`item_'defn(`i'))')dnl
    141170')
    142171dnl }}}
     
    147176')')
    148177define(`DONE', `
    149     dnl ifelse(regexp(defn(`ELEMENTS'), ` $1'), -1, m4_errprint(`Unknown $1') m4exit(1))
    150     define(`ELEMENTS', patsubst(defn(`ELEMENTS'), ` $1\>'))
     178    define(`ELEMENTS_DONE', defn(`ELEMENTS_DONE')`,$1')
    151179    DONE_SIZE(`sizeof(src->$1)')
    152180')
     
    186214EXPORT(`zval')
    187215
    188 include(hashtable.m4)
    189 include(string.m4)
    190 include(struct.m4)
    191 include(dispatch.m4)
    192 include(head.m4)
     216include(srcdir`/processor/hashtable.m4')
     217include(srcdir`/processor/string.m4')
     218include(srcdir`/processor/struct.m4')
     219include(srcdir`/processor/dispatch.m4')
     220include(srcdir`/processor/head.m4')
    193221
    194222define(`IFNOTMEMCPY', `ifdef(`USEMEMCPY', `', `$1')')
    195 REDEF(`KIND', `calc') include(processor.m4)
    196 REDEF(`KIND', `store') include(processor.m4)
    197 REDEF(`KIND', `restore') include(processor.m4)
     223REDEF(`KIND', `calc') include(srcdir`/processor/processor.m4')
     224REDEF(`KIND', `store') include(srcdir`/processor/processor.m4')
     225REDEF(`KIND', `restore') include(srcdir`/processor/processor.m4')
    198226
    199227REDEF(`IFNOTMEMCPY', `$1')
    200228#ifdef HAVE_XCACHE_DPRINT
    201 REDEF(`KIND', `dprint') include(processor.m4)
     229REDEF(`KIND', `dprint') include(srcdir`/processor/processor.m4')
    202230#endif /* HAVE_XCACHE_DPRINT */
    203231#ifdef HAVE_XCACHE_DISASSEMBLER
    204 REDEF(`KIND', `dasm') include(processor.m4)
     232REDEF(`KIND', `dasm') include(srcdir`/processor/processor.m4')
    205233#endif /* HAVE_XCACHE_DISASSEMBLER */
    206234#ifdef HAVE_XCACHE_ASSEMBLER
    207 REDEF(`KIND', `asm') include(processor.m4)
     235REDEF(`KIND', `asm') include(srcdir`/processor/processor.m4')
    208236#endif /* HAVE_XCACHE_ASSEMBLER */
    209237
Note: See TracChangeset for help on using the changeset viewer.