com php-src: Fixed condition check: ext/bcmath/libbcmath/src/config.h ext/gd/gdcache.c ext/mcrypt/mcrypt.c ext/sockets/multicast.c ext/standard/crypt_freesec.h ext/standard/crypt_sha2 56.c ext/standard/crypt_sha512.c ext/standa rd/dl.c ext/standard/html.c ext/standard/password.c ext/standard/php_crypt_r.c ext/standard/random.c main/fopen_wrappers.c main/php_ini.c main/stream s/plain_wrapper.c sapi/phpdbg/phpdbg_prompt.c

[email protected] (Xinchen Hui)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    4bebcb84ad47e687fc3ef3a01b875aa04dfb72d0
Author:    Xinchen Hui <[email protected]>         Mon, 10 Apr 2017 14:47:24 +0800
Parents:   66411ee62ee8bd5e015c901092014dd9229fca01
Branches:  PHP-7.0 PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=4bebcb84ad47e687fc3ef3a01b875aa04dfb72d0

Log:
Fixed condition check

Changed paths:
  M  ext/bcmath/libbcmath/src/config.h
  M  ext/gd/gdcache.c
  M  ext/mcrypt/mcrypt.c
  M  ext/sockets/multicast.c
  M  ext/standard/crypt_freesec.h
  M  ext/standard/crypt_sha256.c
  M  ext/standard/crypt_sha512.c
  M  ext/standard/dl.c
  M  ext/standard/html.c
  M  ext/standard/password.c
  M  ext/standard/php_crypt_r.c
  M  ext/standard/random.c
  M  main/fopen_wrappers.c
  M  main/php_ini.c
  M  main/streams/plain_wrapper.c
  M  sapi/phpdbg/phpdbg_prompt.c


Diff:
diff --git a/ext/bcmath/libbcmath/src/config.h b/ext/bcmath/libbcmath/src/config.h
index cc29a15..100163d 100644
--- a/ext/bcmath/libbcmath/src/config.h
+++ b/ext/bcmath/libbcmath/src/config.h
@@ -1,4 +1,4 @@
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "../../../../main/config.w32.h"
 #else
 #include <php_config.h>
diff --git a/ext/gd/gdcache.c b/ext/gd/gdcache.c
index e6f9ce1..80723ae 100644
--- a/ext/gd/gdcache.c
+++ b/ext/gd/gdcache.c
@@ -39,7 +39,7 @@
 #include "php.h"
 
 /* This just seems unessacary */
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #define ENABLE_GD_TTF
 #else
 #include <php_config.h>
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index c589b40..5e32c32 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -26,7 +26,7 @@
 
 #if HAVE_LIBMCRYPT
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 # include "win32/winutil.h"
 #endif
 
@@ -1376,7 +1376,7 @@ PHP_FUNCTION(mcrypt_create_iv)
 	iv = ecalloc(size + 1, 1);
 
 	if (source == RANDOM || source == URANDOM) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
 		/* random/urandom equivalent on Windows */
 		BYTE *iv_b = (BYTE *) iv;
 		if (php_win32_get_random_bytes(iv_b, (size_t) size) == FAILURE){
diff --git a/ext/sockets/multicast.c b/ext/sockets/multicast.c
index 40335a1..4e5d399 100644
--- a/ext/sockets/multicast.c
+++ b/ext/sockets/multicast.c
@@ -627,7 +627,7 @@ static int _php_source_op_to_ipv4_op(enum source_op sop)
 
 #endif /* HAS_MCAST_EXT */
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr)
 {
 	MIB_IPADDRTABLE *addr_table;
diff --git a/ext/standard/crypt_freesec.h b/ext/standard/crypt_freesec.h
index 860462a..288c216 100644
--- a/ext/standard/crypt_freesec.h
+++ b/ext/standard/crypt_freesec.h
@@ -3,7 +3,7 @@
 #ifndef _CRYPT_FREESEC_H
 #define _CRYPT_FREESEC_H
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 # ifndef inline
 # define inline __inline
 # endif
diff --git a/ext/standard/crypt_sha256.c b/ext/standard/crypt_sha256.c
index 38c2859..6a380bd 100644
--- a/ext/standard/crypt_sha256.c
+++ b/ext/standard/crypt_sha256.c
@@ -68,7 +68,7 @@ struct sha256_ctx {
 	char buffer[128]; /* NB: always correctly aligned for uint32_t.  */
 };
 
-#if PHP_WIN32 || (!defined(WORDS_BIGENDIAN))
+#if defined(PHP_WIN32) || (!defined(WORDS_BIGENDIAN))
 # define SWAP(n) \
     (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
 #else
diff --git a/ext/standard/crypt_sha512.c b/ext/standard/crypt_sha512.c
index 3cef9a3..3373182 100644
--- a/ext/standard/crypt_sha512.c
+++ b/ext/standard/crypt_sha512.c
@@ -63,7 +63,7 @@ struct sha512_ctx
 };
 
 
-#if PHP_WIN32 || (!defined(WORDS_BIGENDIAN))
+#if defined(PHP_WIN32) || (!defined(WORDS_BIGENDIAN))
 # define SWAP(n) \
   (((n) << 56)					\
    | (((n) & 0xff00) << 40)			\
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index cef9716..0c08caa 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -131,7 +131,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now)
 	/* load dynamic symbol */
 	handle = DL_LOAD(libpath);
 	if (!handle) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
 		char *err = GET_DL_ERROR();
 		if (err && (*err != '\0')) {
 			php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, err);
diff --git a/ext/standard/html.c b/ext/standard/html.c
index 74db565..039cda7 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -39,7 +39,7 @@
  */
 
 #include "php.h"
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "config.w32.h"
 #else
 #include <php_config.h>
diff --git a/ext/standard/password.c b/ext/standard/password.c
index 4657f6a..33c6e5c 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -32,7 +32,7 @@
 #include "info.h"
 #include "php_random.h"
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 #include "win32/winutil.h"
 #endif
 
diff --git a/ext/standard/php_crypt_r.c b/ext/standard/php_crypt_r.c
index cddf1d3..0162733 100644
--- a/ext/standard/php_crypt_r.c
+++ b/ext/standard/php_crypt_r.c
@@ -37,7 +37,7 @@
 
 #include <string.h>
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 # include <windows.h>
 # include <Wincrypt.h>
 #endif
@@ -123,7 +123,7 @@ to64(char *s, int32_t v, int n)
 	}
 }
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
 	HCRYPTPROV hCryptProv;
 	HCRYPTHASH ctx, ctx1;
diff --git a/ext/standard/random.c b/ext/standard/random.c
index 1434450..b52566c 100644
--- a/ext/standard/random.c
+++ b/ext/standard/random.c
@@ -27,7 +27,7 @@
 #include "zend_exceptions.h"
 #include "php_random.h"
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 # include "win32/winutil.h"
 #endif
 #ifdef __linux__
@@ -83,7 +83,7 @@ PHP_MSHUTDOWN_FUNCTION(random)
 /* {{{ */
 PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw)
 {
-#if PHP_WIN32
+#ifdef PHP_WIN32
 	/* Defer to CryptGenRandom on Windows */
 	if (php_win32_get_random_bytes(bytes, size) == FAILURE) {
 		if (should_throw) {
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c
index 17dd27a..e1f89ce 100644
--- a/main/fopen_wrappers.c
+++ b/main/fopen_wrappers.c
@@ -505,7 +505,7 @@ PHPAPI zend_string *php_resolve_path(const char *filename, int filename_length,
 	     (IS_SLASH(filename[1]) ||
 	      ((filename[1] == '.') && IS_SLASH(filename[2])))) ||
 	    IS_ABSOLUTE_PATH(filename, filename_length) ||
-#if PHP_WIN32
+#ifdef PHP_WIN32
 		/* This should count as an absolute local path as well, however
 		   IS_ABSOLUTE_PATH doesn't care about this path form till now. It
 		   might be a big thing to extend, thus just a local handling for
diff --git a/main/php_ini.c b/main/php_ini.c
index 99f11d5..79c9d09 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -804,11 +804,11 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len)
 	zval *tmp2;
 	char *ptr;
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 	char path_bak[MAXPATHLEN];
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 	/* MAX_PATH is \0-terminated, path_len == MAXPATHLEN would overrun path_bak */
 	if (path_len >= MAXPATHLEN) {
 #else
@@ -817,7 +817,7 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len)
 		return;
 	}
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 	memcpy(path_bak, path, path_len);
 	path_bak[path_len] = 0;
 	TRANSLATE_SLASHES_LOWER(path_bak);
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 39c629b..9643617 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -1302,7 +1302,7 @@ static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const char *url, i
 		return 0;
 	}
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 	if (!php_win32_check_trailing_space(url, (int)strlen(url))) {
 		php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
 		return 0;
@@ -1329,11 +1329,11 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
 #endif
 	mode_t mode;
 	int ret = 0;
-#if PHP_WIN32
+#ifdef PHP_WIN32
 	int url_len = (int)strlen(url);
 #endif
 
-#if PHP_WIN32
+#ifdef PHP_WIN32
 	if (!php_win32_check_trailing_space(url, url_len)) {
 		php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
 		return 0;
diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c
index 0b4e69c..9fe4fc7 100644
--- a/sapi/phpdbg/phpdbg_prompt.c
+++ b/sapi/phpdbg/phpdbg_prompt.c
@@ -1257,7 +1257,7 @@ PHPDBG_API const char *phpdbg_load_module_or_extension(char **path, char **name)
 	handle = DL_LOAD(*path);
 
 	if (!handle) {
-#if PHP_WIN32
+#ifdef PHP_WIN32
 		char *err = GET_DL_ERROR();
 		if (err && err[0]) {
 			phpdbg_error("dl", "type=\"unknown\"", "%s", err);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.