com php-src: Fix issue #89 — Compile failure in PHP 5.4: phpdbg_utils.h

From: Date: Wed, 11 Jun 2014 20:35:12 +0000
Subject: com php-src: Fix issue #89 — Compile failure in PHP 5.4: phpdbg_utils.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78879@lists.php.net to get a copy of this message
Commit: 3d48c7e5ec86c3cf1ffb06916b4097810cd17563 Author: Bob Weinand <bobwei9@hotmail.com> Wed, 11 Jun 2014 23:35:12 +0300 Parents: 60d89e47b2f4c87c151c422634aafb8b5e9f81bc Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3d48c7e5ec86c3cf1ffb06916b4097810cd17563 Log: Fix issue #89 — Compile failure in PHP 5.4 zend_hash_get_current_key_zval_ex isn't defined in PHP 5.4. (used in phpdbg_watch.c) Bugs: https://bugs.php.net/89 Changed paths: M phpdbg_utils.h Diff: diff --git a/phpdbg_utils..h b/phpdbg_utils.h index 68ae7e4..56bacfc 100644 --- a/phpdbg_utils.h +++ b/phpdbg_utils.h @@ -124,4 +124,24 @@ PHPDBG_API int phpdbg_get_terminal_width(TSRMLS_D); /* }}} */ int phpdbg_rebuild_symtable(TSRMLS_D); +#if PHP_VERSION_ID < 50500 +/* copy from zend_hash.c PHP 5.5 for 5.4 compatibility */ +static void zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, HashPosition *pos) { + Bucket *p; + + p = pos ? (*pos) : ht->pInternalPointer; + + if (!p) { + Z_TYPE_P(key) = IS_NULL; + } else if (p->nKeyLength) { + Z_TYPE_P(key) = IS_STRING; + Z_STRVAL_P(key) = IS_INTERNED(p->arKey) ? (char*)p->arKey : estrndup(p->arKey, p->nKeyLength - 1); + Z_STRLEN_P(key) = p->nKeyLength - 1; + } else { + Z_TYPE_P(key) = IS_LONG; + Z_LVAL_P(key) = p->h; + } +} +#endif + #endif /* PHPDBG_UTILS_H */

« previous php.cvs (#78879) next »