]> granicus.if.org Git - php/commitdiff
- Fix macro definition syntax
authorSteph Fox <sfox@php.net>
Sat, 21 Jun 2008 19:40:41 +0000 (19:40 +0000)
committerSteph Fox <sfox@php.net>
Sat, 21 Jun 2008 19:40:41 +0000 (19:40 +0000)
- Remove pre-existing workaround

ext/phar/phar_internal.h
ext/phar/zip.c

index e41101ab3dc21dadb822665aaaa428c012b1f536..e8873dec5c57ee4e8ab55ad3de2ea875c6e875a9 100755 (executable)
@@ -80,7 +80,8 @@
 #endif
 
 #ifndef ALLOC_PERMANENT_ZVAL
-# define ALLOC_PERMANENT_ZVAL (z) = (zval*)malloc(sizeof(zval));
+# define ALLOC_PERMANENT_ZVAL(z) \
+       (z) = (zval*)malloc(sizeof(zval))
 #endif
 
 /* PHP_ because this is public information via MINFO */
index 636360b90f8b1801fa49ea0121200a95cb343102..54a6c75583d2787a5f797f66fa03319f8d6f53b7 100644 (file)
@@ -213,15 +213,13 @@ int phar_parse_zipfile(php_stream *fp, char *fname, int fname_len, char *alias,
                                if (phar_parse_metadata(&metadata, &mydata->metadata, PHAR_GET_16(locator.comment_len) TSRMLS_CC) == FAILURE) {
                                        mydata->metadata_len = 0;
                                        /* if not valid serialized data, it is a regular string */
-#if PHP_VERSION_ID >= 50300
+
                                        if (entry.is_persistent) {
                                                ALLOC_PERMANENT_ZVAL(mydata->metadata);
                                        } else {
                                                ALLOC_ZVAL(mydata->metadata);
                                        }
-#else
-                                       ALLOC_ZVAL(mydata->metadata);
-#endif
+
                                        INIT_ZVAL(*mydata->metadata);
                                        metadata = pestrndup(metadata, PHAR_GET_16(locator.comment_len), mydata->is_persistent);
                                        ZVAL_STRINGL(mydata->metadata, metadata, PHAR_GET_16(locator.comment_len), 0);
@@ -409,15 +407,13 @@ foundit:
                        if (phar_parse_metadata(&p, &(entry.metadata), PHAR_GET_16(zipentry.comment_len) TSRMLS_CC) == FAILURE) {
                                entry.metadata_len = 0;
                                /* if not valid serialized data, it is a regular string */
-#if PHP_VERSION_ID >= 50300
+
                                if (entry.is_persistent) {
                                        ALLOC_PERMANENT_ZVAL(entry.metadata);
                                } else {
                                        ALLOC_ZVAL(entry.metadata);
                                }
-#else
-                               ALLOC_ZVAL(entry.metadata);
-#endif
+
                                INIT_ZVAL(*entry.metadata);
                                ZVAL_STRINGL(entry.metadata, pestrndup(buf, PHAR_GET_16(zipentry.comment_len), entry.is_persistent), PHAR_GET_16(zipentry.comment_len), 0);
                        }