Changeset 11

Show
Ignore:
Timestamp:
05/24/2006 07:52:48 AM (3 years ago)
Author:
moo
Message:

make it build on windows vc compiler

Location:
trunk
Files:
1 added
14 modified

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.frag

    r6 r11  
    88 
    99$(XCACHE_INCLUDES_I): $(XCACHE_INCLUDES_SRC) $(srcdir)/xcache.h 
    10     $(CC) -I. -I$(srcdir) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS)  -E $(XCACHE_INCLUDES_SRC) -o $(XCACHE_INCLUDES_I) 
     10    $(CC) -I. -I$(srcdir) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -E $(XCACHE_INCLUDES_SRC) -o $(XCACHE_INCLUDES_I) 
    1111 
    1212$(XCACHE_STRUCT_OUT): $(XCACHE_INCLUDES_I) $(srcdir)/mkstructinfo.awk 
     
    1414 
    1515$(XCACHE_PROC_OUT): $(XCACHE_PROC_SRC) $(XCACHE_STRUCT_OUT) $(XCACHE_PROC_SOURCES) 
    16     m4 -D srcdir="$(srcdir)/" -D builddir="$(builddir)" $(XCACHE_ENABLE_TEST) -E $(XCACHE_PROC_SRC) > $(XCACHE_PROC_OUT).tmp && mv -f $(XCACHE_PROC_OUT).tmp $(XCACHE_PROC_OUT) 
     16    $(M4) -D srcdir="$(srcdir)" -D builddir="$(builddir)" $(XCACHE_ENABLE_TEST) -E $(XCACHE_PROC_SRC) > $(XCACHE_PROC_OUT).tmp 
     17    mv -f $(XCACHE_PROC_OUT).tmp $(XCACHE_PROC_OUT) 
    1718 
    1819$(XCACHE_PROC_H): $(XCACHE_PROC_OUT) 
    19     grep -F 'export: ' $(XCACHE_PROC_OUT) | sed -r 's/.*export:(.*):export.*/\1/g' | $(XCACHE_INDENT) > $(XCACHE_PROC_H).tmp && mv -f $(XCACHE_PROC_H).tmp $(XCACHE_PROC_H) 
     20    $(GREP) -F 'export: ' $(XCACHE_PROC_OUT) | $(SED) -r 's/.*export:(.*):export.*/\1/g' | $(XCACHE_INDENT) > $(XCACHE_PROC_H).tmp 
     21    mv -f $(XCACHE_PROC_H).tmp $(XCACHE_PROC_H) 
    2022 
    2123$(XCACHE_PROC_C): $(XCACHE_PROC_OUT) $(XCACHE_PROC_H) 
    22     cat $(XCACHE_PROC_OUT) | $(XCACHE_INDENT) > $(XCACHE_PROC_C).tmp && mv -f $(XCACHE_PROC_C).tmp $(XCACHE_PROC_C) 
     24    $(XCACHE_INDENT) < $(XCACHE_PROC_OUT) > $(XCACHE_PROC_C).tmp 
     25    mv -f $(XCACHE_PROC_C).tmp $(XCACHE_PROC_C) 
    2326 
    2427$(builddir)/processor.lo: $(XCACHE_PROC_C) $(XCACHE_PROC_H) $(srcdir)/processor.c 
  • trunk/config.m4

    r8 r11  
    1 dnl 
    2 dnl $Id:$ 
    31dnl vim:ts=2:sw=2:expandtab 
    42 
    53AC_DEFUN([XCACHE_OPTION], [ 
    6   PHP_ARG_ENABLE(xcache-$1, for XCACHE $1, 
    7   [  --enable-xcache-$2    XCACHE: $4], no, no) 
    8   if test "$PHP_$3" = "yes"; then 
     4  PHP_ARG_ENABLE(xcache-$1, for XCache $1, 
     5  [  --enable-xcache-$2    XCache: $4], no, no) 
     6  if test "$PHP_$3" != "no"; then 
    97    xcache_sources="$xcache_sources $1.c" 
    108    HAVE_$3=1 
    11     AC_DEFINE([HAVE_$3], 1, [Define for XCACHE: $4]) 
     9    AC_DEFINE([HAVE_$3], 1, [Define for XCache: $4]) 
    1210  else 
    1311    HAVE_$3= 
     
    1513])dnl 
    1614 
    17 PHP_ARG_ENABLE(xcache, for XCACHE support, 
    18 [  --enable-xcache         Include XCACHE support.]) 
     15PHP_ARG_ENABLE(xcache, for XCache support, 
     16[  --enable-xcache         Include XCache support.]) 
    1917 
    2018if test "$PHP_XCACHE" != "no"; then 
     
    3937  PHP_ADD_MAKEFILE_FRAGMENT() 
    4038 
    41   PHP_ARG_ENABLE(xcache-test, for XCACHE self test, 
    42   [  --enable-xcache-test            XCACHE: Enable self test - FOR DEVELOPERS ONLY!!], no, no) 
    43   if test "$PHP_XCACHE_TEST" = "yes"; then 
     39  PHP_ARG_ENABLE(xcache-test, for XCache self test, 
     40  [  --enable-xcache-test            XCache: Enable self test - FOR DEVELOPERS ONLY!!], no, no) 
     41  if test "$PHP_XCACHE_TEST" != "no"; then 
    4442    XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST 
    45     AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCACHE self test]) 
     43    AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test]) 
    4644  else 
    4745    XCACHE_ENABLE_TEST= 
     
    4947  PHP_SUBST([XCACHE_ENABLE_TEST]) 
    5048 
    51   AC_PATH_PROGS(INDENT, [indent cat]) 
     49  AC_PATH_PROGS([AWK], [gawk awk]) 
     50  AC_PATH_PROGS([M4], [m4]) 
     51  AC_PATH_PROGS([GREP], [grep]) 
     52  AC_PATH_PROGS([SED], [sed]) 
     53 
     54  AC_PATH_PROGS([INDENT], [indent cat]) 
    5255  case $INDENT in 
    5356  */indent[)] 
     
    6467  PHP_SUBST([XCACHE_PROC_SOURCES]) 
    6568 
    66   AC_MSG_CHECKING(if you have opcode_spec_def.h for xcache) 
     69  AC_MSG_CHECKING(if you have opcode_spec_def.h for XCache) 
    6770  if test -e "$ac_srcdir/opcode_spec_def.h" ; then 
    68     AC_DEFINE([HAVE_XCACHE_OPCODE_SPEC_DEF], 1, [Define if you have opcode_spec_def.h for xcache]) 
     71    AC_DEFINE([HAVE_XCACHE_OPCODE_SPEC_DEF], 1, [Define if you have opcode_spec_def.h for XCache]) 
    6972    AC_MSG_RESULT(yes) 
    7073  else 
     
    7477      AC_MSG_ERROR([cannot build with $1, $ac_srcdir/opcode_spec_def.h required]) 
    7578    ]) 
    76     if test "$HAVE_XCACHE_DISASSEMBLER" = "1" ; then 
     79    if test "$PHP_XCACHE_DISASSEMBLER" != "no" ; then 
    7780      ERROR(disassembler) 
    7881    fi 
  • trunk/coverage.c

    r1 r11  
    55#   include <sys/file.h> 
    66#endif 
     7#include <sys/types.h> 
     8#include <sys/stat.h> 
     9#include <fcntl.h> 
     10 
    711#include "stack.h" 
    812#include "xcache_globals.h" 
     
    305309    zend_uint size; 
    306310    coverage_t cov; 
    307     int i; 
     311    zend_uint i; 
    308312 
    309313    if (op_array->type != ZEND_USER_FUNCTION) { 
     
    312316 
    313317    size = xc_coverage_get_op_array_size_no_tail(op_array); 
    314     cov = xc_coverage_get(op_array->filename); 
    315     for (i = 0; i < size; i++) { 
     318    cov = xc_coverage_get(op_array->filename TSRMLS_CC); 
     319    for (i = 0; i < size; i ++) { 
    316320        switch (op_array->opcodes[i].opcode) { 
    317321            case ZEND_EXT_STMT: 
     
    351355void xc_coverage_handle_ext_stmt(zend_op_array *op_array, zend_uchar op) /* {{{ */ 
    352356{ 
     357    TSRMLS_FETCH(); 
     358 
    353359    if (XG(coveragedumper) && XG(coverages)) { 
    354         TSRMLS_FETCH(); 
    355360        int size = xc_coverage_get_op_array_size_no_tail(op_array); 
    356361        int oplineno = (*EG(opline_ptr)) - op_array->opcodes; 
    357362        if (oplineno < size) { 
    358             xc_coverage_add_hits(xc_coverage_get(op_array->filename), (*EG(opline_ptr))->lineno, 1 TSRMLS_CC); 
     363            xc_coverage_add_hits(xc_coverage_get(op_array->filename TSRMLS_CC), (*EG(opline_ptr))->lineno, 1 TSRMLS_CC); 
    359364        } 
    360365    } 
  • trunk/lock.c

    r1 r11  
    66#ifndef ZEND_WIN32 
    77typedef int HANDLE; 
     8#   define CloseHandle(h) close(h) 
    89#endif 
    910#include "lock.h" 
     
    1819#   include <fcntl.h> 
    1920#   include <errno.h> 
     21#   define LCK_WR F_WRLCK 
     22#   define LCK_RD F_RDLCK 
     23#   define LCK_UN F_UNLCK 
     24#   define LCK_NB 0 
    2025static inline int dolock(xc_lock_t *lck, int type) /* {{{ */ 
    2126{  
     
    3540} 
    3641/* }}} */ 
    37 #define LCK_WR F_WRLCK 
    38 #define LCK_RD F_RDLCK 
    39 #define LCK_UN F_UNLCK 
    40 #define LCK_NB 0 
    4142#else 
    4243 
     
    4647#   include <sys/types.h> 
    4748#   include <sys/stat.h> 
    48 #   define errno GetLastError() 
     49#   ifndef errno 
     50#       define errno GetLastError() 
     51#   endif 
     52#   define getuid() 0 
     53#   define LCK_WR LOCKFILE_EXCLUSIVE_LOCK 
     54#   define LCK_RD 0 
     55#   define LCK_UN 0 
     56#   define LCK_NB LOCKFILE_FAIL_IMMEDIATELY 
    4957static inline int dolock(xc_lock_t *lck, int type) /* {{{ */ 
    5058{  
     
    5260 
    5361    if (type == LCK_UN) { 
    54         return UnlockFileEx((HANDLE)fd, 0, 1, 0, &offset); 
     62        return UnlockFileEx((HANDLE)lck->fd, 0, 1, 0, &offset); 
    5563    } 
    5664    else { 
    57         return LockFileEx((HANDLE)fd, type, 0, 1, 0, &offset); 
     65        return LockFileEx((HANDLE)lck->fd, type, 0, 1, 0, &offset); 
    5866    } 
    5967} 
    6068/* }}} */ 
    61 #define LCK_WR LOCKFILE_EXCLUSIVE_LOCK 
    62 #define LCK_RD 0 
    63 #define LCK_UN 0 
    64 #define LCK_NB LOCKFILE_FAIL_IMMEDIATELY 
    6569#endif 
    6670 
     
    6872{ 
    6973    HANDLE fd; 
    70     char myname[sizeof("/tmp/.xcache.lock") - 1 + 20]; 
     74    char myname[sizeof("/tmp/.xcache.lock") - 1 + 100]; 
    7175 
    7276    if (pathname == NULL) { 
    7377        static int i = 0; 
    74         snprintf(myname, sizeof(myname) - 1, "/tmp/.xcache.%d.%d.lock", (int) getuid(), i ++); 
     78        snprintf(myname, sizeof(myname) - 1, "/tmp/.xcache.%d.%d.%d.lock", (int) getuid(), i ++, rand()); 
    7579        pathname = myname; 
    7680    } 
    7781 
    78     fd = open(pathname, O_RDWR|O_CREAT, 0666); 
     82    fd = (HANDLE) open(pathname, O_RDWR|O_CREAT, 0666); 
    7983 
    8084    if (fd > 0) { 
     
    99103void xc_fcntl_destroy(xc_lock_t *lck) /* {{{ */ 
    100104{    
    101     close(lck->fd); 
     105    CloseHandle(lck->fd); 
    102106#ifdef __CYGWIN__ 
    103107    unlink(lck->pathname); 
  • trunk/mmap.c

    r1 r11  
    77#include <string.h> 
    88#include <stdlib.h> 
     9 
    910/* mmap */ 
    10 #include <unistd.h> 
     11#ifdef ZEND_WIN32 
     12#   define ftruncate chsize 
     13#   define getuid() 0 
     14#   define XcacheCreateFileMapping(size, perm, name) \ 
     15        CreateFileMapping(INVALID_HANDLE_VALUE, NULL, perm, (sizeof(xc_shmsize_t) > 4) ? size >> 32 : 0, size & 0xffffffff, name) 
     16#   define XCACHE_MAP_FAILED NULL 
     17#   define munmap(p, s) UnmapViewOfFile(p) 
     18#else 
     19#   include <unistd.h> 
     20#   define XCACHE_MAP_FAILED MAP_FAILED 
     21#endif 
     22 
    1123#include <sys/types.h> 
    1224#include <sys/stat.h> 
    1325#include <fcntl.h> 
     26 
     27#ifndef ZEND_WIN32 
    1428#include <sys/mman.h> 
     29#endif 
    1530 
    1631#include "php.h" 
     
    2742    long  diff; 
    2843    xc_shmsize_t size; 
     44    char *name; 
     45#ifdef ZEND_WIN32 
     46    HANDLE hmap; 
     47    HANDLE hmap_ro; 
     48#endif 
    2949}; 
    3050 
     51#undef NDEBUG 
    3152#ifdef ALLOC_DEBUG 
    32 #   undef NDEBUG 
    3353#   define inline 
    3454#else 
     
    3858/* }}} */ 
    3959#define CHECK(x, e) do { if ((x) == NULL) { zend_error(E_ERROR, "XCache: " e); goto err; } } while (0) 
     60#define PTR_ADD(ptr, v) (((char *) (ptr)) + (v)) 
     61#define PTR_SUB(ptr, v) (((char *) (ptr)) - (v)) 
    4062 
    4163int xc_shm_can_readonly(xc_shm_t *shm) /* {{{ */ 
     
    5880    if (shm->diff) { 
    5981        assert(xc_shm_is_readonly(p)); 
    60         p = p - shm->diff; 
     82        p = PTR_SUB(p, -shm->diff); 
    6183    } 
    6284    assert(xc_shm_is_readwrite(p)); 
     
    6890    assert(xc_shm_is_readwrite(p)); 
    6991    if (shm->diff) { 
    70         p = p + shm->diff; 
     92        p = PTR_ADD(p, shm->diff); 
    7193        assert(xc_shm_is_readonly(p)); 
    7294    } 
     
    90112        */ 
    91113    } 
     114#ifdef ZEND_WIN32 
     115    if (shm->hmap) { 
     116        CloseHandle(shm->hmap); 
     117    } 
     118    if (shm->hmap_ro) { 
     119        CloseHandle(shm->hmap_ro); 
     120    } 
     121#endif 
     122 
     123    if (shm->name) { 
     124#ifdef __CYGWIN__ 
     125        unlink(shm->name); 
     126#endif 
     127        free(shm->name); 
     128    } 
    92129    /* 
    93130    shm->size = NULL; 
     
    102139{ 
    103140    xc_shm_t *shm = NULL; 
    104     int fd; 
     141    int fd = -1; 
    105142    int ro_ok; 
    106143    volatile void *romem; 
    107     int created = 0; 
     144    char tmpname[sizeof("/tmp/xcache") - 1 + 100]; 
    108145 
    109146    CHECK(shm = calloc(1, sizeof(xc_shm_t)), "shm OOM"); 
    110147    shm->size = size; 
     148 
    111149    if (path == NULL || !path[0]) { 
    112         path = "/tmp/xcache"; 
    113     } 
    114     fd = open(path, O_RDWR, S_IRUSR | S_IWUSR); 
     150        static int inc = 0; 
     151        snprintf(tmpname, sizeof(tmpname) - 1, "/tmp/xcache.%d.%d.%d", (int) getuid(), inc ++, rand()); 
     152        path = tmpname; 
     153    } 
     154 
     155    shm->name = strdup(path); 
     156 
     157#ifndef ZEND_WIN32 
     158#   define XCACHE_MMAP_PERMISSION (S_IRUSR | S_IWUSR) 
     159    fd = open(shm->name, O_RDWR, XCACHE_MMAP_PERMISSION); 
    115160    if (fd == -1) { 
    116         created = 1; 
    117         fd = open(path, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); 
     161        fd = open(shm->name, O_CREAT | O_RDWR, XCACHE_MMAP_PERMISSION); 
    118162        if (fd == -1) { 
    119             if (created) { 
    120                 unlink(path); 
    121             } 
    122163            goto err; 
    123164        } 
    124165    } 
    125166    ftruncate(fd, size); 
    126  
     167#endif 
     168 
     169#ifdef ZEND_WIN32 
     170    shm->hmap = XcacheCreateFileMapping(size, PAGE_READWRITE, shm->name); 
     171    shm->ptr = (LPSTR) MapViewOfFile(shm->hmap, FILE_MAP_WRITE, 0, 0, 0); 
     172#else 
    127173    shm->ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 
    128     if (shm->ptr == MAP_FAILED) { 
     174#endif 
     175 
     176    if (shm->ptr == XCACHE_MAP_FAILED) { 
    129177        shm->ptr = NULL; 
    130         close(fd); 
    131         if (created) { 
    132             unlink(path); 
    133         } 
    134178        goto err; 
    135179    } 
     
    137181    ro_ok = 0; 
    138182    if (readonly_protection) { 
     183#ifdef ZEND_WIN32 
     184        shm->hmap_ro = XcacheCreateFileMapping(size, PAGE_READONLY, shm->name); 
     185        shm->ptr_ro = (LPSTR) MapViewOfFile(shm->hmap_ro, FILE_MAP_READ, 0, 0, 0); 
     186#else 
    139187        shm->ptr_ro = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); 
     188#endif 
    140189        romem = shm->ptr_ro; 
    141190 
    142191        /* {{{ check if ptr_ro works */ 
    143192        do { 
    144             if (shm->ptr_ro == MAP_FAILED || shm->ptr_ro == shm->ptr) { 
     193            if (shm->ptr_ro == XCACHE_MAP_FAILED || shm->ptr_ro == shm->ptr) { 
    145194                break; 
    146195            } 
     
    158207 
    159208    if (ro_ok) { 
    160         shm->diff = shm->ptr_ro - shm->ptr; 
     209        shm->diff = PTR_SUB(shm->ptr_ro, (char *) shm->ptr); 
    161210        assert(abs(shm->diff) >= size); 
    162211    } 
    163212    else { 
    164         if (shm->ptr_ro != MAP_FAILED) { 
     213        if (shm->ptr_ro != XCACHE_MAP_FAILED) { 
    165214            munmap(shm->ptr_ro, size); 
    166215        } 
     
    171220 
    172221    close(fd); 
    173     if (created) { 
    174         unlink(path); 
    175     } 
     222#ifndef __CYGWIN__ 
     223    unlink(shm->name); 
     224#endif 
    176225 
    177226    return shm; 
    178227 
    179228err: 
     229    if (fd != -1) { 
     230        close(fd); 
     231    } 
    180232    if (shm) { 
    181233        xc_shm_destroy(shm); 
  • trunk/myshm.h

    r1 r11  
    11typedef struct _xc_shm_t xc_shm_t; 
    2 typedef unsigned int xc_shmsize_t; 
     2typedef size_t xc_shmsize_t; 
    33 
    44int xc_shm_can_readonly(xc_shm_t *shm); 
  • trunk/processor/main.m4

    r4 r11  
    1515dnl }}} 
    1616dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5:forcetype=$2) 
    17 dnl don't use typeof(dst) as we need the compiler warning 
    1817define(`ALLOC', ` 
    1918    pushdef(`COUNT', `ifelse(`$3', `', `1', `$3')') 
  • trunk/processor/processor.m4

    r4 r11  
    365365    DISPATCH(int, op_type) 
    366366 
     367#ifdef IS_CV 
     368#   define XCACHE_IS_CV IS_CV 
     369#else 
     370/* compatible with zend optimizer */ 
     371#   define XCACHE_IS_CV 16 
     372#endif 
    367373    assert(src->op_type == IS_CONST || 
    368374        src->op_type == IS_VAR || 
    369 #ifdef IS_CV 
    370         src->op_type == IS_CV || 
    371 #else 
    372         src->op_type == 16 || /* zend optimizer */ 
    373 #endif 
     375        src->op_type == XCACHE_IS_CV || 
    374376        src->op_type == IS_TMP_VAR || 
    375377        src->op_type == IS_UNUSED); 
     378#undef XCACHE_IS_CV 
    376379    dnl dirty dispatch 
    377380    DISABLECHECK(` 
     
    463466    do { 
    464467    dnl RESTORE is done above! 
     468    zend_uint ii; 
    465469    int i; 
    466470 
     
    481485    /* useless */ 
    482486    COPY(prototype) 
    483     STRUCT_ARRAY(num_args, zend_arg_info, arg_info) 
     487    STRUCT_ARRAY_I(num_args, zend_arg_info, arg_info) 
    484488    DISPATCH(zend_uint, num_args) 
    485489    DISPATCH(zend_uint, required_num_args) 
     
    490494        IFCOPY(`memcpy(dst->arg_types, src->arg_types, sizeof(src->arg_types[0]) * (src->arg_types[0]+1));') 
    491495        IFDASM(`do { 
     496            zend_uint ii; 
    492497            int i; 
    493498            zval *zv; 
     
    528533        processor->active_opcodes_src = src->opcodes; 
    529534    ')') 
    530     STRUCT_ARRAY(last, zend_op, opcodes) 
     535    STRUCT_ARRAY_I(last, zend_op, opcodes) 
    531536    popdef(`AFTER_ALLOC') 
    532537    DISPATCH(zend_uint, last) 
     
    546551    DISPATCH(zend_uint, T) 
    547552 
    548     STRUCT_ARRAY(last_brk_cont, zend_brk_cont_element, brk_cont_array) 
     553    STRUCT_ARRAY_I(last_brk_cont, zend_brk_cont_element, brk_cont_array) 
    549554    DISPATCH(zend_uint, last_brk_cont) 
    550555    DISPATCH(zend_uint, current_brk_cont) 
  • trunk/processor/string.m4

    r1 r11  
    3636        ') 
    3737        IFCALC(`xc_calc_string_n(processor, ISTYPE, (void *) $2, `$3' IFASSERT(`, __LINE__'));') 
    38         IFSTORE(`$1 = (typeof($1)) xc_store_string_n(processor, ISTYPE, (char *) $2, `$3' IFASSERT(`, __LINE__'));') 
     38        IFSTORE(`$1 = (STRTYPE *) xc_store_string_n(processor, ISTYPE, (char *) $2, `$3' IFASSERT(`, __LINE__'));') 
    3939        IFRESTORE(` 
    40             ALLOC(`$1', `typeof($1[0])', `sizeof(STRTYPE) * ($3)') 
     40            ALLOC(`$1', `STRTYPE', `sizeof(STRTYPE) * ($3)') 
    4141            memcpy($1, $2, sizeof(STRTYPE) * ($3)); 
    4242        ') 
    43         FIXPOINTER_EX(`typeof($1[0])', `$1') 
     43        FIXPOINTER_EX(`STRTYPE', `$1') 
    4444        IFDASM(` 
    4545                ifelse(STRTYPE,UChar, ` 
  • trunk/processor/struct.m4

    r4 r11  
    3939            IFRESTORE(`assert(xc_is_shm(src));') 
    4040            IFCALCSTORE(`assert(!xc_is_shm(src));') 
     41            do { 
    4142        ') 
    4243 
    4344        ifdef(`USEMEMCPY', `IFCOPY(` 
    4445            memcpy(dst, src, sizeof($1)); 
     46            do { 
    4547        ')') 
    4648 
     
    8486                /* }}} */ 
    8587        ')') 
     88        ifdef(`USEMEMCPY', `IFCOPY(` 
     89            } while (0); 
     90        ')') 
    8691        IFASSERT(` 
     92            } while (0); 
    8793            undefine(`ELEMENTS_DONE') 
    8894        ') 
     
    144150') 
    145151dnl }}} 
     152dnl {{{ STRUCT_ARRAY_I(1:count, 2:type, 3:elm, 4:name=type) 
     153define(`STRUCT_ARRAY_I', ` 
     154pushdef(`i', `ii') 
     155STRUCT_ARRAY(`$1', `$2', `$3', `$4') 
     156popdef(`i') 
     157') 
     158dnl }}} 
    146159dnl {{{ STRUCT_ARRAY(1:count, 2:type, 3:elm, 4:name=type) 
    147160define(`STRUCT_ARRAY', ` 
  • trunk/stack.c

    r1 r11  
    5151void xc_stack_reverse(S stack) 
    5252{ 
    53     typeof(stack->cnt) i, j; 
     53    int i, j; 
    5454    void *tmp; 
    5555 
  • trunk/utils.c

    r8 r11  
    234234{ 
    235235    zend_op *opline; 
    236     int i; 
     236    zend_uint i; 
    237237 
    238238    opline = op_array->opcodes; 
     
    282282ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, zend_uchar type, void *key, uint len TSRMLS_DC) /* {{{ */ 
    283283{ 
     284    zend_class_entry *cep = CestToCePtr(*cest); 
    284285    ZESW(void *stored_ce_ptr, ); 
    285     zend_class_entry *cep = CestToCePtr(*cest); 
    286286 
    287287    if (zend_u_hash_add(CG(class_table), type, key, len, 
  • trunk/xcache.c

    r9 r11  
    2727#include "opcode_spec.h" 
    2828 
     29#undef NDEBUG 
    2930#ifdef DEBUG 
    30 #   undef NDEBUG 
    3131#   undef inline 
    3232#   define inline 
     
    340340    for (i = 0, c = cache->hentry->size; i < c; i ++) { 
    341341        for (e = cache->entries[i]; e; e = e->next) { 
    342             xc_fillentry_dmz(e, 0, list); 
     342            xc_fillentry_dmz(e, 0, list TSRMLS_CC); 
    343343        } 
    344344    } 
     
    348348    array_init(list); 
    349349    for (e = cache->deletes; e; e = e->next) { 
    350         xc_fillentry_dmz(e, 1, list); 
     350        xc_fillentry_dmz(e, 1, list TSRMLS_CC); 
    351351    } 
    352352    add_assoc_zval(return_value, "deleted_list", list); 
     
    402402    int i; 
    403403    xc_cache_t *cache; 
    404     typeof(cache->deletes) p, *last; 
     404    typedef xc_entry_t *xc_delete_t; 
     405    xc_delete_t p, *last; 
    405