Browse Source

Fixed condition check

pull/2438/merge
Xinchen Hui 9 years ago
parent
commit
4bebcb84ad
  1. 2
      ext/bcmath/libbcmath/src/config.h
  2. 2
      ext/gd/gdcache.c
  3. 4
      ext/mcrypt/mcrypt.c
  4. 2
      ext/sockets/multicast.c
  5. 2
      ext/standard/crypt_freesec.h
  6. 2
      ext/standard/crypt_sha256.c
  7. 2
      ext/standard/crypt_sha512.c
  8. 2
      ext/standard/dl.c
  9. 2
      ext/standard/html.c
  10. 2
      ext/standard/password.c
  11. 4
      ext/standard/php_crypt_r.c
  12. 4
      ext/standard/random.c
  13. 2
      main/fopen_wrappers.c
  14. 6
      main/php_ini.c
  15. 6
      main/streams/plain_wrapper.c
  16. 2
      sapi/phpdbg/phpdbg_prompt.c

2
ext/bcmath/libbcmath/src/config.h

@ -1,4 +1,4 @@
#if PHP_WIN32
#ifdef PHP_WIN32
#include "../../../../main/config.w32.h" #include "../../../../main/config.w32.h"
#else #else
#include <php_config.h> #include <php_config.h>

2
ext/gd/gdcache.c

@ -39,7 +39,7 @@
#include "php.h" #include "php.h"
/* This just seems unessacary */ /* This just seems unessacary */
#if PHP_WIN32
#ifdef PHP_WIN32
#define ENABLE_GD_TTF #define ENABLE_GD_TTF
#else #else
#include <php_config.h> #include <php_config.h>

4
ext/mcrypt/mcrypt.c

@ -26,7 +26,7 @@
#if HAVE_LIBMCRYPT #if HAVE_LIBMCRYPT
#if PHP_WIN32
#ifdef PHP_WIN32
# include "win32/winutil.h" # include "win32/winutil.h"
#endif #endif
@ -1376,7 +1376,7 @@ PHP_FUNCTION(mcrypt_create_iv)
iv = ecalloc(size + 1, 1); iv = ecalloc(size + 1, 1);
if (source == RANDOM || source == URANDOM) { if (source == RANDOM || source == URANDOM) {
#if PHP_WIN32
#ifdef PHP_WIN32
/* random/urandom equivalent on Windows */ /* random/urandom equivalent on Windows */
BYTE *iv_b = (BYTE *) iv; BYTE *iv_b = (BYTE *) iv;
if (php_win32_get_random_bytes(iv_b, (size_t) size) == FAILURE){ if (php_win32_get_random_bytes(iv_b, (size_t) size) == FAILURE){

2
ext/sockets/multicast.c

@ -627,7 +627,7 @@ static int _php_source_op_to_ipv4_op(enum source_op sop)
#endif /* HAS_MCAST_EXT */ #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) int php_if_index_to_addr4(unsigned if_index, php_socket *php_sock, struct in_addr *out_addr)
{ {
MIB_IPADDRTABLE *addr_table; MIB_IPADDRTABLE *addr_table;

2
ext/standard/crypt_freesec.h

@ -3,7 +3,7 @@
#ifndef _CRYPT_FREESEC_H #ifndef _CRYPT_FREESEC_H
#define _CRYPT_FREESEC_H #define _CRYPT_FREESEC_H
#if PHP_WIN32
#ifdef PHP_WIN32
# ifndef inline # ifndef inline
# define inline __inline # define inline __inline
# endif # endif

2
ext/standard/crypt_sha256.c

@ -68,7 +68,7 @@ struct sha256_ctx {
char buffer[128]; /* NB: always correctly aligned for uint32_t. */ 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) \ # define SWAP(n) \
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
#else #else

2
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) \ # define SWAP(n) \
(((n) << 56) \ (((n) << 56) \
| (((n) & 0xff00) << 40) \ | (((n) & 0xff00) << 40) \

2
ext/standard/dl.c

@ -131,7 +131,7 @@ PHPAPI int php_load_extension(char *filename, int type, int start_now)
/* load dynamic symbol */ /* load dynamic symbol */
handle = DL_LOAD(libpath); handle = DL_LOAD(libpath);
if (!handle) { if (!handle) {
#if PHP_WIN32
#ifdef PHP_WIN32
char *err = GET_DL_ERROR(); char *err = GET_DL_ERROR();
if (err && (*err != '\0')) { if (err && (*err != '\0')) {
php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, err); php_error_docref(NULL, error_type, "Unable to load dynamic library '%s' - %s", libpath, err);

2
ext/standard/html.c

@ -39,7 +39,7 @@
*/ */
#include "php.h" #include "php.h"
#if PHP_WIN32
#ifdef PHP_WIN32
#include "config.w32.h" #include "config.w32.h"
#else #else
#include <php_config.h> #include <php_config.h>

2
ext/standard/password.c

@ -32,7 +32,7 @@
#include "info.h" #include "info.h"
#include "php_random.h" #include "php_random.h"
#if PHP_WIN32
#ifdef PHP_WIN32
#include "win32/winutil.h" #include "win32/winutil.h"
#endif #endif

4
ext/standard/php_crypt_r.c

@ -37,7 +37,7 @@
#include <string.h> #include <string.h>
#if PHP_WIN32
#ifdef PHP_WIN32
# include <windows.h> # include <windows.h>
# include <Wincrypt.h> # include <Wincrypt.h>
#endif #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) { char * php_md5_crypt_r(const char *pw, const char *salt, char *out) {
HCRYPTPROV hCryptProv; HCRYPTPROV hCryptProv;
HCRYPTHASH ctx, ctx1; HCRYPTHASH ctx, ctx1;

4
ext/standard/random.c

@ -27,7 +27,7 @@
#include "zend_exceptions.h" #include "zend_exceptions.h"
#include "php_random.h" #include "php_random.h"
#if PHP_WIN32
#ifdef PHP_WIN32
# include "win32/winutil.h" # include "win32/winutil.h"
#endif #endif
#ifdef __linux__ #ifdef __linux__
@ -83,7 +83,7 @@ PHP_MSHUTDOWN_FUNCTION(random)
/* {{{ */ /* {{{ */
PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw) 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 */ /* Defer to CryptGenRandom on Windows */
if (php_win32_get_random_bytes(bytes, size) == FAILURE) { if (php_win32_get_random_bytes(bytes, size) == FAILURE) {
if (should_throw) { if (should_throw) {

2
main/fopen_wrappers.c

@ -505,7 +505,7 @@ PHPAPI zend_string *php_resolve_path(const char *filename, int filename_length,
(IS_SLASH(filename[1]) || (IS_SLASH(filename[1]) ||
((filename[1] == '.') && IS_SLASH(filename[2])))) || ((filename[1] == '.') && IS_SLASH(filename[2])))) ||
IS_ABSOLUTE_PATH(filename, filename_length) || IS_ABSOLUTE_PATH(filename, filename_length) ||
#if PHP_WIN32
#ifdef PHP_WIN32
/* This should count as an absolute local path as well, however /* This should count as an absolute local path as well, however
IS_ABSOLUTE_PATH doesn't care about this path form till now. It 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 might be a big thing to extend, thus just a local handling for

6
main/php_ini.c

@ -804,11 +804,11 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len)
zval *tmp2; zval *tmp2;
char *ptr; char *ptr;
#if PHP_WIN32
#ifdef PHP_WIN32
char path_bak[MAXPATHLEN]; char path_bak[MAXPATHLEN];
#endif #endif
#if PHP_WIN32
#ifdef PHP_WIN32
/* MAX_PATH is \0-terminated, path_len == MAXPATHLEN would overrun path_bak */ /* MAX_PATH is \0-terminated, path_len == MAXPATHLEN would overrun path_bak */
if (path_len >= MAXPATHLEN) { if (path_len >= MAXPATHLEN) {
#else #else
@ -817,7 +817,7 @@ PHPAPI void php_ini_activate_per_dir_config(char *path, size_t path_len)
return; return;
} }
#if PHP_WIN32
#ifdef PHP_WIN32
memcpy(path_bak, path, path_len); memcpy(path_bak, path, path_len);
path_bak[path_len] = 0; path_bak[path_len] = 0;
TRANSLATE_SLASHES_LOWER(path_bak); TRANSLATE_SLASHES_LOWER(path_bak);

6
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; return 0;
} }
#if PHP_WIN32
#ifdef PHP_WIN32
if (!php_win32_check_trailing_space(url, (int)strlen(url))) { if (!php_win32_check_trailing_space(url, (int)strlen(url))) {
php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT)); php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
return 0; return 0;
@ -1329,11 +1329,11 @@ static int php_plain_files_metadata(php_stream_wrapper *wrapper, const char *url
#endif #endif
mode_t mode; mode_t mode;
int ret = 0; int ret = 0;
#if PHP_WIN32
#ifdef PHP_WIN32
int url_len = (int)strlen(url); int url_len = (int)strlen(url);
#endif #endif
#if PHP_WIN32
#ifdef PHP_WIN32
if (!php_win32_check_trailing_space(url, url_len)) { if (!php_win32_check_trailing_space(url, url_len)) {
php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT)); php_error_docref1(NULL, url, E_WARNING, "%s", strerror(ENOENT));
return 0; return 0;

2
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); handle = DL_LOAD(*path);
if (!handle) { if (!handle) {
#if PHP_WIN32
#ifdef PHP_WIN32
char *err = GET_DL_ERROR(); char *err = GET_DL_ERROR();
if (err && err[0]) { if (err && err[0]) {
phpdbg_error("dl", "type=\"unknown\"", "%s", err); phpdbg_error("dl", "type=\"unknown\"", "%s", err);

Loading…
Cancel
Save