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

merge from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

  • branches/1.3/processor/struct.m4

    r623 r726  
    3030    {
    3131        pushdef(`ELEMENTS_DONE')
    32         ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: $1: missing structinfo, dont panic')define(`SIZEOF_$1', 0)')
    3332        IFASSERT(`
    3433            /* {{{ init assert */
    35             ifdef(`SIZEOF_$1', , `m4_errprint(`missing SIZEOF_$1, safe to ignore')define(`SIZEOF_$1', 0)')
    36             ifdef(`COUNTOF_$1', , `m4_errprint(`missing COUNTOF_$1, safe to ignore')define(`COUNTOF_$1', 0)')
     34            ifdef(`SIZEOF_$1', , `m4_errprint(`missing SIZEOF_$1, safe to ignore')')
     35            ifdef(`COUNTOF_$1', , `m4_errprint(`missing COUNTOF_$1, safe to ignore'))')
    3736            dnl SIZEOF_x COUNTOF_x can be both defined or both not
    3837            ifdef(`SIZEOF_$1', `
     
    4847            int assert_size = SIZEOF_$1, assert_count = COUNTOF_$1;
    4948            int done_size = 0, done_count = 0;
     49            const char *assert_names[] = { ifdef(`ELEMENTSOF_$1', `ELEMENTSOF_$1') };
     50            HashTable done_names;
     51            zend_hash_init(&done_names, 0, NULL, NULL, 0);
    5052            /* }}} */
    5153            IFRESTORE(`assert(xc_is_shm(src));')
     
    5355            do {
    5456        ')
     57        ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: $1: missing structinfo, dont panic')')
    5558
    5659        ifdef(`USEMEMCPY', `IFCOPY(`
     
    6871            INDENT()fprintf(stderr, "}\n");
    6972        ')
    70         ifdef(`SKIPASSERT_ONCE', `undefine(`SKIPASSERT_ONCE')', `
     73        ifdef(`SKIPASSERT_ONCE', `
     74            undefine(`SKIPASSERT_ONCE')
    7175            IFASSERT(`
    72                 /* {{{ check assert */
     76                zend_hash_destroy(&done_names);
     77            ')
     78        ', `
     79            IFASSERT(`
     80            /* {{{ check assert */ do {
     81                int name_check_errors = xc_check_names(__FILE__, __LINE__, "FUNC_NAME", assert_names, sizeof(assert_names) / sizeof(assert_names[0]), &done_names);
     82                zend_hash_destroy(&done_names);
     83
    7384                if (done_count != assert_count) {
    7485                    fprintf(stderr
     
    8596                        );
    8697                }
    87                 if (done_count != assert_count || done_size != assert_size) {
     98                if (name_check_errors || done_count != assert_count || done_size != assert_size) {
    8899                    assert(0);
    89100                }
    90                 /* }}} */
     101            } while (0); /* }}} */
    91102            ')
    92103            ifdef(`ELEMENTSOF_$1', `
Note: See TracChangeset for help on using the changeset viewer.