Changeset 1561 in svn


Ignore:
Timestamp:
2014-11-10T11:07:01Z (4 years ago)
Author:
Xuefer
Message:

fix build for older PHP

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/xc_cacher.c

    r1560 r1561  
    14241424            if ((Z_TYPE_P(constant) & IS_CONSTANT_TYPE_MASK) == IS_STRING) {
    14251425                XCACHE_ANALYZE_CONSTANT(file, 0)
     1426#   ifdef ZEND_ENGINE_2_3
    14261427                else XCACHE_ANALYZE_CONSTANT(dir, 0)
     1428#   endif
    14271429            }
    14281430#   ifdef IS_UNICODE
     
    14641466        if (Z_TYPE_P(constant) == IS_STRING) {
    14651467            XCACHE_ANALYZE_CONSTANT(file, 0)
     1468#   ifdef ZEND_ENGINE_2_3
    14661469            else XCACHE_ANALYZE_CONSTANT(dir, 0)
     1470#   endif
    14671471        }
    14681472#   ifdef IS_UNICODE
     
    15211525            detail.index = oplinenum;
    15221526            detail.info  = constantinfo;
    1523             xc_vector_add(xc_constant_info_t, &constantinfos, detail);
     1527            xc_vector_push_back(&constantinfos, &detail);
    15241528        }
    15251529    }
     
    15841588            xc_restore_constant_string("class_constant", constant, Z_TYPE_P(constant), &entry_php->filepath, &entry_php->u_filepath, shallow_copy TSRMLS_CC);
    15851589        }
     1590#   ifdef ZEND_ENGINE_2_3
    15861591        else if ((constantinfo & xcache_constant_is_dir)) {
    15871592            xc_restore_constant_string("class_constant", constant, Z_TYPE_P(constant), &entry_php->dirpath, &entry_php->u_dirpath, shallow_copy TSRMLS_CC);
    15881593        }
     1594#   endif
    15891595    }
    15901596}
     
    36703676
    36713677            TRACE("%s", "incdec: notlong");
    3672             if (stored_entry_var->objects_count) {
     3678            if (stored_entry_var->class_names_count) {
    36733679                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot convert object to integer");
    36743680                value = 0;
  • trunk/mod_optimizer/xc_optimizer.c

    r1551 r1561  
    519519{
    520520    int bbid;
     521#ifdef ZEND_ENGINE_2
    521522    int i;
     523#endif
    522524
    523525    for (bbid = 0; bbid < bbs_count(bbs); bbid ++) {
  • trunk/processor/foot.m4

    r1560 r1561  
    154154    if (src->objects_count) {
    155155        for (i = 0; i < src->objects_count; ++i) {
    156             zend_objects_store_del_ref_by_handle_ex(processor.object_handles[i], NULL TSRMLS_CC);
     156            zend_objects_store_del_ref_by_handle(processor.object_handles[i] TSRMLS_CC);
    157157        }
    158158        efree(processor.object_handles);
  • trunk/processor/processor.m4

    r1560 r1561  
    14251425        popdef(`src')
    14261426        xc_vector_destroy(&processor->objects);
    1427         if (SRC(`objects_count')) {
    1428             xc_vector_init(xc_constant_string_t, &processor->class_names, 0);
    1429             zend_hash_init(&processor->class_name_to_index, 0, NULL, NULL, 0);
    1430         }
    14311427    ')
    14321428    dnl must be after calc .value
     
    14581454        /* no longer needed */
    14591455        if (vsrc->class_names_count) {
    1460             dnl size_t i;
    1461             dnl for (i = 0; i < vsrc->class_names_count; ++i) {
    1462             dnl     efree(vsrc->class_names[i]);
    1463             dnl }
    14641456            efree(vsrc->class_names);
    14651457            vsrc->class_names_count = 0;
  • trunk/processor/var-helper-t.h

    r1560 r1561  
    11/* {{{ var object helpers */
    2 zend_bool             have_objects;
     2#ifdef ZEND_ENGINE_2
    33xc_vector_t           objects;         /* in calc only */
    44HashTable             handle_to_index; /* in calc/store only */
    55zend_object_handle   *object_handles;  /* in restore only */
     6#endif
    67const xc_entry_var_t *entry_var_src;   /* in restore */
    78
  • trunk/processor/var-helper.h

    r1560 r1561  
    22static void xc_var_collect_object(xc_processor_t *processor, zend_object_handle handle TSRMLS_DC) /* {{{ */
    33{
    4     size_t next_index = xc_vector_size(&processor->objects);
     4    size_t next_index;
    55
    66    if (!xc_vector_initialized(&processor->objects)) {
     
    99    }
    1010
     11    next_index = xc_vector_size(&processor->objects);
    1112    if (_zend_hash_index_update_or_next_insert(&processor->handle_to_index, handle, (void *) &next_index, sizeof(next_index), NULL, HASH_ADD ZEND_FILE_LINE_CC) == SUCCESS) {
    1213        zend_object *object = zend_object_store_get_object_by_handle(handle TSRMLS_CC);
     
    3738static void xc_var_collect_class(xc_processor_t *processor, zend_class_entry *ce TSRMLS_DC) /* {{{ */
    3839{
    39     size_t next_index = xc_vector_size(&processor->class_names);
     40    size_t next_index;
    4041
     42    if (!xc_vector_initialized(&processor->class_names)) {
     43        xc_vector_init(xc_constant_string_t, &processor->class_names, 0);
     44        zend_hash_init(&processor->class_name_to_index, 0, NULL, NULL, 0);
     45    }
     46
     47    next_index = xc_vector_size(&processor->class_names);
    4148    if (zend_hash_add(&processor->class_name_to_index, ce->name, ce->name_length, (void *) &next_index, sizeof(next_index), NULL) == SUCCESS) {
    4249        xc_constant_string_t class_name;
  • trunk/xcache/xc_compatibility.c

    r1321 r1561  
    4444/* }}} */
    4545#endif
     46
     47#if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_2)
     48void *xc_object_store_get_object_by_handle(zend_object_handle handle TSRMLS_DC) /* {{{ */
     49{
     50    zval zobject;
     51    Z_OBJ_HANDLE_P(&zobject) = handle;
     52    return zend_object_store_get_object(&zobject TSRMLS_CC);
     53}
     54/* }}} */
     55void xc_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC) /* {{{ */
     56{
     57    zval zobject;
     58    Z_OBJ_HANDLE_P(&zobject) = handle;
     59    zend_objects_store_add_ref(&zobject TSRMLS_CC);
     60}
     61/* }}} */
     62void xc_objects_store_del_ref_by_handle(zend_object_handle handle TSRMLS_DC) /* {{{ */
     63{
     64    zval zobject;
     65    Z_OBJ_HANDLE_P(&zobject) = handle;
     66    zobject.refcount = 0;
     67    zend_objects_store_del_ref(&zobject TSRMLS_CC);
     68}
     69/* }}} */
     70#endif
  • trunk/xcache/xc_compatibility.h

    r1525 r1561  
    283283#endif
    284284
     285#if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_2)
     286void *xc_object_store_get_object_by_handle(zend_object_handle handle TSRMLS_DC);
     287#   define zend_object_store_get_object_by_handle xc_object_store_get_object_by_handle
     288
     289void xc_objects_store_add_ref_by_handle(zend_object_handle handle TSRMLS_DC);
     290#   define zend_objects_store_add_ref_by_handle xc_objects_store_add_ref_by_handle
     291
     292void xc_objects_store_del_ref_by_handle(zend_object_handle handle TSRMLS_DC);
     293#   define zend_objects_store_del_ref_by_handle xc_objects_store_del_ref_by_handle
     294#endif
     295
    285296#endif /* XC_COMPATIBILITY_H_54F26ED90198353558718191D5EE244C */
  • trunk/xcache/xc_utils.c

    r1560 r1561  
    642642{
    643643    xc_cest_t *cest;
    644 #ifdef ZEND_ENGINE_2
     644#ifdef ZEND_ENGINE_2_4
    645645    if (zend_lookup_class_ex(class_name, class_name_len, NULL, autoload, &cest TSRMLS_CC) != SUCCESS) {
    646646        return NULL;
    647647    }
     648#elif defined(ZEND_ENGINE_2)
     649    if (zend_lookup_class_ex(class_name, class_name_len, autoload, &cest TSRMLS_CC) != SUCCESS) {
     650        return NULL;
     651    }
    648652#else
    649653    if (zend_hash_find(EG(class_table), class_name, class_name_len, (void **) &cest) != SUCCESS) {
Note: See TracChangeset for help on using the changeset viewer.