mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Replace WIN32 conditions with _WIN32 or PHP_WIN32 (#14462)
* Replace WIN32 conditions with _WIN32 or PHP_WIN32
WIN32 is defined by the SDK and not defined all the time on Windows by
compilers or the environment. _WIN32 is defined as 1 when the
compilation target is 32-bit ARM, 64-bit ARM, x86, or x64. Otherwise,
undefined.
This syncs these usages one step further.
Upstream libgd has replaced WIN32 with _WIN32 via
c60d9fe577
PHP_WIN32 is added to ext/sockets/sockets.stub.php as done in other
*.stub.php files at this point.
* Use PHP_WIN32 in ext/random
* Use PHP_WIN32 in ext/sockets
* Use _WIN32 in xxhash.h as done upstream
See https://github.com/Cyan4973/xxHash/pull/931
* Update end comment with PHP_WIN32
This commit is contained in:
parent
bcecbb59d3
commit
a82d86479c
11 changed files with 62 additions and 62 deletions
|
@ -13,7 +13,7 @@
|
|||
#ifndef TSRM_H
|
||||
#define TSRM_H
|
||||
|
||||
#if !defined(__CYGWIN__) && defined(WIN32)
|
||||
#if !defined(__CYGWIN__) && defined(_WIN32)
|
||||
# define TSRM_WIN32
|
||||
# include "Zend/zend_config.w32.h"
|
||||
#else
|
||||
|
|
|
@ -21,7 +21,7 @@ extern "C" {
|
|||
/* default fontpath for netware systems */
|
||||
#define DEFAULT_FONTPATH "sys:/java/nwgfx/lib/x11/fonts/ttf;."
|
||||
#define PATHSEPARATOR ";"
|
||||
#elif defined(WIN32)
|
||||
#elif defined(_WIN32)
|
||||
/* default fontpath for windows systems */
|
||||
#define DEFAULT_FONTPATH "c:\\winnt\\fonts;c:\\windows\\fonts;."
|
||||
#define PATHSEPARATOR ";"
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#define access _access
|
||||
#ifndef R_OK
|
||||
#define R_OK 2
|
||||
|
|
|
@ -229,7 +229,7 @@ extern "C" {
|
|||
*/
|
||||
/* specific declaration modes for Windows */
|
||||
#if !defined(XXH_INLINE_ALL) && !defined(XXH_PRIVATE_API)
|
||||
# if defined(WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT))
|
||||
# if defined(_WIN32) && defined(_MSC_VER) && (defined(XXH_IMPORT) || defined(XXH_EXPORT))
|
||||
# ifdef XXH_EXPORT
|
||||
# define XXH_PUBLIC_API __declspec(dllexport)
|
||||
# elif XXH_IMPORT
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#define SIZE_MAX ((size_t)~0)
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef _WIN32
|
||||
#ifdef MBFL_DLL_EXPORT
|
||||
#define MBFLAPI __declspec(dllexport)
|
||||
#else
|
||||
|
@ -55,6 +55,6 @@
|
|||
#else
|
||||
#define MBFLAPI
|
||||
#endif /* defined(__GNUC__) && __GNUC__ >= 4 */
|
||||
#endif /* WIN32 */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#endif /* MBFL_DEFS_H */
|
||||
|
|
|
@ -635,7 +635,7 @@ PHPAPI uint64_t php_random_generate_fallback_seed(void)
|
|||
/* Various PIDs. */
|
||||
pid = getpid();
|
||||
fallback_seed_add(&c, &pid, sizeof(pid));
|
||||
#ifndef WIN32
|
||||
#ifndef PHP_WIN32
|
||||
pid = getppid();
|
||||
fallback_seed_add(&c, &pid, sizeof(pid));
|
||||
#endif
|
||||
|
|
|
@ -153,31 +153,31 @@ PHP_SOCKETS_API bool socket_import_file_descriptor(PHP_SOCKET socket, php_socket
|
|||
#define PHP_NORMAL_READ 0x0001
|
||||
#define PHP_BINARY_READ 0x0002
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EINTR WSAEINTR
|
||||
#elif defined(EINTR)
|
||||
#define PHP_SOCKET_EINTR EINTR
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EBADF WSAEBADF
|
||||
#elif defined(EBADF)
|
||||
#define PHP_SOCKET_EBADF EBADF
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EACCES WSAEACCES
|
||||
#elif defined(EACCES)
|
||||
#define PHP_SOCKET_EACCES EACCES
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EFAULT WSAEFAULT
|
||||
#elif defined(EFAULT)
|
||||
#define PHP_SOCKET_EFAULT EFAULT
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EINVAL WSAEINVAL
|
||||
#elif defined(EINVAL)
|
||||
#define PHP_SOCKET_EINVAL EINVAL
|
||||
|
@ -187,217 +187,217 @@ PHP_SOCKETS_API bool socket_import_file_descriptor(PHP_SOCKET socket, php_socket
|
|||
#define PHP_SOCKET_ENFILE ENFILE
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EMFILE WSAEMFILE
|
||||
#elif defined(EMFILE)
|
||||
#define PHP_SOCKET_EMFILE EMFILE
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#elif defined(EWOULDBLOCK)
|
||||
#define PHP_SOCKET_EWOULDBLOCK EWOULDBLOCK
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EINPROGRESS WSAEINPROGRESS
|
||||
#elif defined(EINPROGRESS)
|
||||
#define PHP_SOCKET_EINPROGRESS EINPROGRESS
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EALREADY WSAEALREADY
|
||||
#elif defined(EALREADY)
|
||||
#define PHP_SOCKET_EALREADY EALREADY
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ENOTSOCK WSAENOTSOCK
|
||||
#elif defined(ENOTSOCK)
|
||||
#define PHP_SOCKET_ENOTSOCK ENOTSOCK
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EDESTADDRREQ WSAEDESTADDRREQ
|
||||
#elif defined(EDESTADDRREQ)
|
||||
#define PHP_SOCKET_EDESTADDRREQ EDESTADDRREQ
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EMSGSIZE WSAEMSGSIZE
|
||||
#elif defined(EMSGSIZE)
|
||||
#define PHP_SOCKET_EMSGSIZE EMSGSIZE
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EPROTOTYPE WSAEPROTOTYPE
|
||||
#elif defined(EPROTOTYPE)
|
||||
#define PHP_SOCKET_EPROTOTYPE EPROTOTYPE
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ENOPROTOOPT WSAENOPROTOOPT
|
||||
#elif defined(ENOPROTOOPT)
|
||||
#define PHP_SOCKET_ENOPROTOOPT ENOPROTOOPT
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EPROTONOSUPPORT WSAEPROTONOSUPPORT
|
||||
#elif defined(EPROTONOSUPPORT)
|
||||
#define PHP_SOCKET_EPROTONOSUPPORT EPROTONOSUPPORT
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
|
||||
#elif defined(ESOCKTNOSUPPORT)
|
||||
#define PHP_SOCKET_ESOCKTNOSUPPORT ESOCKTNOSUPPORT
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EOPNOTSUPP WSAEOPNOTSUPP
|
||||
#elif defined(EOPNOTSUPP)
|
||||
#define PHP_SOCKET_EOPNOTSUPP EOPNOTSUPP
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EPFNOSUPPORT WSAEPFNOSUPPORT
|
||||
#elif defined(EPFNOSUPPORT)
|
||||
#define PHP_SOCKET_EPFNOSUPPORT EPFNOSUPPORT
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#elif defined(EAFNOSUPPORT)
|
||||
#define PHP_SOCKET_EAFNOSUPPORT EAFNOSUPPORT
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EADDRINUSE WSAEADDRINUSE
|
||||
#elif defined(EADDRINUSE)
|
||||
#define PHP_SOCKET_EADDRINUSE EADDRINUSE
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#elif defined(EADDRNOTAVAIL)
|
||||
#define PHP_SOCKET_EADDRNOTAVAIL EADDRNOTAVAIL
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ENETDOWN WSAENETDOWN
|
||||
#elif defined(ENETDOWN)
|
||||
#define PHP_SOCKET_ENETDOWN ENETDOWN
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ENETUNREACH WSAENETUNREACH
|
||||
#elif defined(ENETUNREACH)
|
||||
#define PHP_SOCKET_ENETUNREACH ENETUNREACH
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ENETRESET WSAENETRESET
|
||||
#elif defined(ENETRESET)
|
||||
#define PHP_SOCKET_ENETRESET ENETRESET
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ECONNABORTED WSAECONNABORTED
|
||||
#elif defined(ECONNABORTED)
|
||||
#define PHP_SOCKET_ECONNABORTED ECONNABORTED
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ECONNRESET WSAECONNRESET
|
||||
#elif defined(ECONNRESET)
|
||||
#define PHP_SOCKET_ECONNRESET ECONNRESET
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ENOBUFS WSAENOBUFS
|
||||
#elif defined(ENOBUFS)
|
||||
#define PHP_SOCKET_ENOBUFS ENOBUFS
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EISCONN WSAEISCONN
|
||||
#elif defined(EISCONN)
|
||||
#define PHP_SOCKET_EISCONN EISCONN
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ENOTCONN WSAENOTCONN
|
||||
#elif defined(ENOTCONN)
|
||||
#define PHP_SOCKET_ENOTCONN ENOTCONN
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ESHUTDOWN WSAESHUTDOWN
|
||||
#elif defined(ESHUTDOWN)
|
||||
#define PHP_SOCKET_ESHUTDOWN ESHUTDOWN
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ETOOMANYREFS WSAETOOMANYREFS
|
||||
#elif defined(ETOOMANYREFS)
|
||||
#define PHP_SOCKET_ETOOMANYREFS ETOOMANYREFS
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ETIMEDOUT WSAETIMEDOUT
|
||||
#elif defined(ETIMEDOUT)
|
||||
#define PHP_SOCKET_ETIMEDOUT ETIMEDOUT
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ECONNREFUSED WSAECONNREFUSED
|
||||
#elif defined(ECONNREFUSED)
|
||||
#define PHP_SOCKET_ECONNREFUSED ECONNREFUSED
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ELOOP WSAELOOP
|
||||
#elif defined(ELOOP)
|
||||
#define PHP_SOCKET_ELOOP ELOOP
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ENAMETOOLONG WSAENAMETOOLONG
|
||||
#elif defined(ENAMETOOLONG)
|
||||
#define PHP_SOCKET_ENAMETOOLONG ENAMETOOLONG
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EHOSTDOWN WSAEHOSTDOWN
|
||||
#elif defined(EHOSTDOWN)
|
||||
#define PHP_SOCKET_EHOSTDOWN EHOSTDOWN
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#elif defined(EHOSTUNREACH)
|
||||
#define PHP_SOCKET_EHOSTUNREACH EHOSTUNREACH
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_ENOTEMPTY WSAENOTEMPTY
|
||||
#elif defined(ENOTEMPTY)
|
||||
#define PHP_SOCKET_ENOTEMPTY ENOTEMPTY
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EUSERS WSAEUSERS
|
||||
#elif defined(EUSERS)
|
||||
#define PHP_SOCKET_EUSERS EUSERS
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EDQUOT WSAEDQUOT
|
||||
#elif defined(EDQUOT)
|
||||
#define PHP_SOCKET_EDQUOT EDQUOT
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
#define PHP_SOCKET_EREMOTE WSAEREMOTE
|
||||
#elif defined(EREMOTE)
|
||||
#define PHP_SOCKET_EREMOTE EREMOTE
|
||||
|
|
|
@ -1511,7 +1511,7 @@ const SOCKET_ENOMEDIUM = UNKNOWN;
|
|||
const SOCKET_EMEDIUMTYPE = UNKNOWN;
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef PHP_WIN32
|
||||
/**
|
||||
* @var int
|
||||
* @cvalue WSAESTALE
|
||||
|
|
22
ext/sockets/sockets_arginfo.h
generated
22
ext/sockets/sockets_arginfo.h
generated
|
@ -1,5 +1,5 @@
|
|||
/* This is a generated file, edit the .stub.php file instead.
|
||||
* Stub hash: a551457ae505cd3d0a10da4e4b9897f556c390b4 */
|
||||
* Stub hash: 49b34a1e2f25000d71fb5bf6722db31607ded646 */
|
||||
|
||||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_socket_select, 0, 4, MAY_BE_LONG|MAY_BE_FALSE)
|
||||
ZEND_ARG_TYPE_INFO(1, read, IS_ARRAY, 1)
|
||||
|
@ -902,34 +902,34 @@ static void register_sockets_symbols(int module_number)
|
|||
#if defined(EMEDIUMTYPE)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_EMEDIUMTYPE", EMEDIUMTYPE, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_ESTALE", WSAESTALE, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_EDISCON", WSAEDISCON, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_SYSNOTREADY", WSASYSNOTREADY, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_VERNOTSUPPORTED", WSAVERNOTSUPPORTED, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_NOTINITIALISED", WSANOTINITIALISED, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_HOST_NOT_FOUND", WSAHOST_NOT_FOUND, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_TRY_AGAIN", WSATRY_AGAIN, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_NO_RECOVERY", WSANO_RECOVERY, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_NO_DATA", WSANO_DATA, CONST_PERSISTENT);
|
||||
#endif
|
||||
#if defined(WIN32)
|
||||
#if defined(PHP_WIN32)
|
||||
REGISTER_LONG_CONSTANT("SOCKET_NO_ADDRESS", WSANO_ADDRESS, CONST_PERSISTENT);
|
||||
#endif
|
||||
REGISTER_LONG_CONSTANT("IPPROTO_IP", IPPROTO_IP, CONST_PERSISTENT);
|
||||
|
|
|
@ -55,7 +55,7 @@ static inline int has_crc32_insn(void) {
|
|||
if (sysctlbyname("hw.optional.armv8_crc32", &res, &reslen, NULL, 0) < 0)
|
||||
res = 0;
|
||||
return res;
|
||||
# elif defined(WIN32)
|
||||
# elif defined(_WIN32)
|
||||
res = (int)IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
|
||||
return res;
|
||||
# else
|
||||
|
|
|
@ -2231,7 +2231,7 @@ parent_loop_end:
|
|||
} else {
|
||||
parent = 0;
|
||||
}
|
||||
#endif /* WIN32 */
|
||||
#endif /* PHP_WIN32 */
|
||||
}
|
||||
|
||||
zend_first_try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue