mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fixed condition check
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#if PHP_WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#include "../../../../main/config.w32.h"
|
||||
#else
|
||||
#include <php_config.h>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#ifndef _CRYPT_FREESEC_H
|
||||
#define _CRYPT_FREESEC_H
|
||||
|
||||
#if PHP_WIN32
|
||||
#ifdef PHP_WIN32
|
||||
# ifndef inline
|
||||
# define inline __inline
|
||||
# endif
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) \
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
*/
|
||||
|
||||
#include "php.h"
|
||||
#if PHP_WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#include "config.w32.h"
|
||||
#else
|
||||
#include <php_config.h>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "info.h"
|
||||
#include "php_random.h"
|
||||
|
||||
#if PHP_WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#include "win32/winutil.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user