com php-src: Ignore getcwd return in zend_compile: Zend/z end_compile.c Zend/zend_portability.h main/php.h
| From: | Nikita Popov | Date: | Thu, 16 Jul 2015 20:48:56 +0000 |
| Subject: | com php-src: Ignore getcwd return in zend_compile: Zend/z end_compile.c Zend/zend_portability.h main/php.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-88008@lists.php.net to get a copy of this message | ||
Commit: c568ffe5171d942161fc8dda066bce844bdef676
Author: Nikita Popov <nikic@php.net> Thu, 16 Jul 2015 22:48:56 +0200
Parents: 208257eec56533bf470044eb0595202bd1541462
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c568ffe5171d942161fc8dda066bce844bdef676
Log:
Ignore getcwd return in zend_compile
To do this move the php_ignore_value macro to ZEND_IGNORE_VALUE.
Changed paths:
M Zend/zend_compile.c
M Zend/zend_portability.h
M main/php.h
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 4cf2a57..f63c9f3 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5667,9 +5667,9 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{
*/
if (strcmp(ZSTR_VAL(dirname), ".") == 0) {
dirname = zend_string_extend(dirname, MAXPATHLEN, 0);
#if HAVE_GETCWD
- VCWD_GETCWD(ZSTR_VAL(dirname), MAXPATHLEN);
+ ZEND_IGNORE_VALUE(VCWD_GETCWD(ZSTR_VAL(dirname), MAXPATHLEN));
#elif HAVE_GETWD
- VCWD_GETWD(ZSTR_VAL(dirname));
+ ZEND_IGNORE_VALUE(VCWD_GETWD(ZSTR_VAL(dirname)));
#endif
}
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index 214ece5..42a70b9 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -117,6 +117,12 @@
# define EMPTY_SWITCH_DEFAULT_CASE() default: ZEND_ASSUME(0); break;
#endif
+#if defined(__GNUC__) && __GNUC__ >= 4
+# define ZEND_IGNORE_VALUE(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
+#else
+# define ZEND_IGNORE_VALUE(x) ((void) (x))
+#endif
+
/* all HAVE_XXX test have to be after the include of zend_config above */
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
diff --git a/main/php.h b/main/php.h
index 1d2c2dc..3ebaa1a 100644
--- a/main/php.h
+++ b/main/php.h
@@ -257,11 +257,7 @@ END_EXTERN_C()
# endif
#endif
-#if defined(__GNUC__) && __GNUC__ >= 4
-# define php_ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
-#else
-# define php_ignore_value(x) ((void) (x))
-#endif
+#define php_ignore_value(x) ZEND_IGNORE_VALUE(x)
/* global variables */
#if !defined(PHP_WIN32)